Articles → MICROSOFT BOT FRAMEWORK → Confirm Dialog In Microsoft Bot Framework

Confirm Dialog In Microsoft Bot Framework


using Microsoft.Bot.Builder.FormFlow;
using System;

namespace Bot_Application1.Dialogs { [Serializable]
  public class FormFlowDemo {
    public string Name;
    public string MobileNumber;
    public string city;
    public static IForm < FormFlowDemo > GetForm() {
      return new FormBuilder < FormFlowDemo > ().Message("Welcome to support chat system. Please place your order").Field(nameof(city)).Confirm(async(state) =>{
        double minOrder = 0;
        switch ( {
        case "delhi":
          minOrder = 100;
        case "gurugram":
          minOrder = 150;
        case "noida":
          minOrder = 250;
        return new PromptAttribute($ "For {}, the minimum order is {minOrder}. Please confirm.");
      }).Field(nameof(MobileNumber)).Field(nameof(Name)).Confirm("Thank you {Name}. Your order is placed. We will deliver your order to {city} in approx. 1 hour").Build();


Picture showing the confirmation message where bot is asking for the minimum order from the user
Click to Enlarge

Picture showing the final confirmation message once the order is placed
Click to Enlarge

Posted By  -  Karan Gupta
Posted On  -  Friday, October 23, 2020


Your Email Id  
Query/FeedbackCharacters remaining 250