Resend a past activity in bot framework with waterfall dialog

Viewed 163

I have a bot with waterfall dialogs, written using adaptive dialogs. After each TextInput the user should be able to go back and edit his submission. Is it possible to send again a specific activity from the bot even though the bot has progressed in the conversation flow? Also all the activities send after the TextInput which has to be edited have to be sent again, so basically the conversation flow should reset from the TextInput the user wants to edit.

1 Answers

You can do that using following code:

stepContext.ActiveDialog.State["stepIndex"] =(int)stepContext.ActiveDialog.State["stepIndex"] - 3;

return await IntroStepAsync(stepContext, cancellationToken);

Where IntroStepAsync is the step name in your dialog and -3 means I am at the third prompt and want to go back to the 3rd last prompt, if you want to go back to the previous step you have to put -1 and replace IntroStepAsync by your previous prompt's name.

Related