title: Azure Bot Framework FormFlow complex forms
body: <p>I'm trying to create a bot with the Azure Bot Framework that will ask for an unknown amount of complex objects (each will require three responses). But I don't know how to create a form for each of the complex objects within the rootform. See <a href="http://docs.botframework.com/sdkreference/csharp/forms.html" rel="nofollow">http://docs.botframework.com/sdkreference/csharp/forms.html</a>.
  It states:
       "In order to handle a list of complex objects, you need to create a form for the top level C# class and also one for the complex object. You can use the Dialogs system to compose the forms together."
  That is what I dont know how to do.</p>
  
  <pre><code>public enum SystemSelection { SharePoint, BizTalk, Azure, Office365 };
  
  public enum RequestType { Bug, SupportRequest, Question };
  
  public enum Importance { Blocking, High, Medium, Low };
  
  [Serializable]
  class Declaration
  {
      public string Type;
      public string Amount;
      public string Date;
  
      public static IForm&lt;Declaration&gt; BuildForm()
      {
          return new FormBuilder&lt;Declaration&gt;()
                  .Message("Add a declaration")
                  .Build();
      }
  }
  
  [Serializable]
  class SupportRequest
  {
  
      public SystemSelection? SystemSelection;
      public RequestType? RequestType;
      public Importance? Importance;
  
      public List&lt;Declaration&gt; Declarations;
  
      public static IForm&lt;SupportRequest&gt; BuildForm()
      {
          IForm&lt;Declaration&gt; aForm = new FormBuilder&lt;Declaration&gt;().Message("Add declaration").Build();
  
          // now what?
  
          return new FormBuilder&lt;SupportRequest&gt;()
                  .Message("Welcome to the simple support bot!")
                  .Build();
      }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>  [BotAuthentication]
    public class MessagesController : ApiController
  {
      internal static IDialog&lt;SupportRequest&gt; MakeRootDialog()
      {
          // change something here??
          return Chain.From(() =&gt; FormDialog.FromForm(SupportRequest.BuildForm));
      }
  
      public async Task&lt;Message&gt; Post([FromBody]Message message)
      {
          if (message.Type == "Message")
          {
              return await Conversation.SendAsync(message, MakeRootDialog);
          }
          else
          {
              return HandleSystemMessage(message);
          }
      }
  </code></pre>