Ekrem Tapan

Ekrem Tapan

  • NA
  • 967
  • 81.7k

Ms Bot Framework Dynamic Form FLow

Aug 24 2017 3:34 AM

I want to ask how can i dynamically control my form question on MS Bot Framework.

For example: Below i have my structure.
   when execute my code then select obj1 i want to jump optionTwo want to skip optionOne when i select obj2 directly jump to optionOne and then skip to optionTwo
 
  1.    public SelectionOne selectionOne;  
  2.    public Option1 optionOne ;  
  3.    public Option2 optionTwo;   
  4.   
  5.    public static IForm<MyForm> BuildForm()  
  6.    {  
  7.             return new FormBuilder<MyForm>()  
  8.                 .Message("Welcome MyForm.")  
  9.   
  10.                 .OnCompletion(async (context, profileForm) =>  
  11.                 {  
  12.                     // Tell the user that the form is complete    
  13.                     await context.PostAsync("Thanks.");  
  14.                 })  
  15.                 .Build();  
  16.     }  
  17. }  
  18.   
  19.     [Serializable]  
  20.     public enum SelectionOne  
  21.     {  
  22.         obj1=1,  
  23.         obj2=2,  
  24.         obj3=3,  
  25.         obj4= 4,  
  26.         obj5= 5,  
  27.         obj6= 6  
  28.     }  
  29.   
  30.     [Serializable]  
  31.     public enum Option1  
  32.     {  
  33.         Type1 = 100,  
  34.         Type2 = 150,  
  35.         Type3 = 220  
  36.     }  
  37.     public enum Option2  
  38.     {  
  39.         Type1 = 100,  
  40.         Type2 = 220  
  41.     }