Including RetryPromptString let’s the bot ask again and everything works out.
Autoprompt skip prompt full#
In my full sample code I have multiple WaterfallSteps and if a user enters an incorrect response, the bot resets the steps and starts from the beginning. Note that if you don’t supply a RetryPromptString and in response to the pizza question, a user enters “hot dog”, the bot won’t react well. Depending on your situation this can be a great option.Īlso the RetryPromptString allows you to provide text to display if the user enters a value that doesn’t match up to one of the provided options. It provides a list of buttons for the user to click. List is just a list.Īs the name suggests, None doesn’t provide any prompts at all. List looks a lot like auto right? (I think Auto will change depending on the channel for your bot. I used Auto before, you can see the result above. While we are here, let’s get into some other settings. This means I can reuse the prompt by providing different text and choices if I want to.īack in my constructor, I add that waterfall step to my Dialogs collection:Ĭheck it out, it works! Here are some screen shots from the emulator: Note that here I am telling the DialogContext to show the ChoicePrompt (referring to it by name “auto”), I supply text (“What kind of pizza…”) and the ChoicePromptOptions. Private async Task AutoPrompt(DialogContext dc, IDictionary args, SkipStepFunction next)Īwait dc.Prompt("auto", "What kind of Pizza would you like?", _choicePromptOptions) I also created a WaterFallStep which is really just a method that looks like this: Var auto = new ChoicePrompt(Culture.English) In the constructor of the DialogContainer I have created a prompt: I want to prompt the user to pick an item from a list, so I use the ChoicePrompt. There are prompts to collect text, numbers, dates, and more.
The questions are asked with the help of a prompt. You can then add a waterfall step for each question you want the user to answer. The replacement for the FormFlow is to use a DialogContainer with a list of WaterfallSteps. The full solution is on github, check it out if you want. While that sample was helpful, I’ll provide more of an explanation. I reached out for some help (being a Microsoft MVP has its privileges) and Gary Pretty came to the rescue, pointing me to a sample here. However, when it came to providing choices for the user, I couldn’t quite figure it out. And of course, you can see the source code for the framework on github. I found most of the docs very helpful and it was pretty easy to get going.
Īgain, I am still learning about the new version of the framework and I won’t begin to explain it all here. That’s ok, the new Bot Builder Framework is better. We had access to the FormBuilder to easily compose a set of prompts to gather the data. Consider that if a bot is taking a pizza order, it would need to ask the customer what kind of pizza, what size, find out about side orders and drinks, etc. With the old version, you could use the FormFlow feature to easily create “forms” that would gather information needed by the bot to accomplish a task. It’s quite different than the predecessor. But if you are building bots for Azure, now is the time to start learning about v4. It’s new so there isn’t a ton of documentation or samples out there. In preparing for some upcoming presentations on Creating Bots, I’m upgrading a bot from Bot Builder SDK v3 to v4. This content is for Bot Builder SDK v4 which is, at the time of writing this, in pre-release.