Introduction
The Bot Framework enables you to build bots that support different types of interactions with users. You can design conversations in your bot to be freeform. Your bot can also have more guided interactions where it provides the user choices or actions. The conversation can use simple text strings or more complex rich cards that contain text, images, and action buttons. And, you can add natural language interactions, which let your users interact with your bots in a natural and expressive way.
Bot Builder SDK introduced Form Flow, it will automatically generate the dialog's conversation based on your property and type that was specified on a class. Bot Dialog also is more powerful but when handling a conversation like a registration or ordering, it requires more effort to complete the process using bot dialog.
In this article, I will help you to understand how to use Bot FormFlow and how you can use it to collect information from the users. We are creating a sample demo Bot for a bus booking bot.

Prerequisite
I have already explained about Bot framework Installation, deployment, and implementation in the below articles.
- Getting Started with Chatbot Using Azure Bot Service
- Getting Started with Bots Using Visual Studio 2017
- Deploying A Bot to Azure Using Visual Studio 2017
- How to Create ChatBot In Xamarin
- Getting Started with Dialog Using Microsoft Bot Framework
- Getting Started with Prompt Dialog Using Microsoft Bot Framework
Create New Bot Service
Let’s create a new Bot Service application using Visual Studio 2017. Open Visual Studio, select File menu, and create a new Project (Ctrl + Shift +N). Here, select Bot application.

The Bot application template is created with all the components and all required NuGet references installed in the solution. Just add a new class for BusFormFlow to the project.

In this solution, we have two main classes - MessagesController.cs and BusFormFlow.
Create New FormFlow Class
We can start creating a class that represents our form and creates properties for each field. Form fields can be one of the following types.
- Enum
- List of Enum
- Integral – sbyte, byte, short, ushort, int, uint, long, ulong
- Floating point – float, double
- String
- DateTime
FormFlow will automatically validate the type based on user input and reply with the validation message.
- Create a new enum field for the point from where the bus starts from.The bot output looks like below.
- /// <summary>
- /// From City Enum
- /// </summary>
- public enum FromCity
- {
- Bangalore,Chennai,Madurai,Trichy,Coimbatore,Tanjore,pudukkottai
- }

- Create a new enum field for bus end point.The bot output looks like below.
- /// <summary>
- /// To City Enum
- /// </summary>
- public enum ToCity
- {
- Bangalore, Chennai, Madurai, Trichy, Coimbatore, Tanjore, Pudukkottai
- }

- Create a new enum for bus type.The output looks like below.
- /// <summary>
- /// Bus Type Enum
- /// </summary>
- public enum BusType
- {
- AC, NonAC,Slepper, Siting
- }





Sanaj M ShajiPosted Aug 27, 2019, 1:42 PM
How we can incorporate bot framework in existing asp.net application with forms authentication
Pankaj KumarPosted May 6, 2019, 6:01 AM
Hi, how to manage this in LUIS ?
Ravi ChallaPosted Aug 1, 2018, 7:28 AM
Hi Mate, Nice Lectures you have on MS Bot Framework really useful.Is there a way i can embed a say Bing Map for instance if i need to provide location in a chatbot experience. In the Formflow .Thank you
Vinodh NarayananPosted Sep 12, 2017, 1:23 AM
Nice article. Thanks for sharing