The Sandwich Bot
Microsoft's example of bot to take a sandwich order is a perfect example of how to use forms. There are only a finite number of things you can put on a sandwich from a given restaurant so it makes sense to build a form to guide a user through the order. The way this works is it takes a serialized class and basically presents a user with a series of questions with clickable answers to keep them within the bounds of the service you offer.
Here is their example class;
Showing the form on a message
The key here is how it makes your SandwichOrder class into a form using the FormDialog class. As I mentioned before, you will get slightly different visual appearances between say a sms message, a web chat bot, and skype chat bot. But the idea is the same, the bot framework makes a cool form that goes question by question and records the users input.
Getting the user to work through selection choices is very cool, and huge time saver, but you need to remember to use last weeks blog to save the data, so when you get through the questions, you know which sandwich and what options the user has selected, then you can take them to a payment website, and deliver the sandwich.
Next week we are going to use some machine learning and show you how to handle types of free text users questions. For this we will employee Microsoft LUIS.