title: Bot framework - Getting the user's answers from a form generated by json schema
body: <p>I am using the function to BuildJsonForm to <a href="https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-formflow-json-schema" rel="nofollow noreferrer">define a form using a JSON schema</a>. I generate the JObject with some parameters the bot asks the user during runtime.</p>
  
  <p>An example of the JObject/JSON I send to the function BuildJsonForm is this one:</p>
  
  <p>`</p>
  
  <pre><code>  {
      "References": [
        "Microsoft.Bot.Connector.dll",
        "System.dll",
        "mscorlib.dll",
        "System.Net.Http.dll"
      ],
      "Imports": [
        "Microsoft.Bot.Connector.ThumbnailCard",
        "Microsoft.Bot.Connector.StateClient",
        "System.Net.Mail",
        "System",
        "System.Text.RegularExpressions",
        "System.Net.Http",
        "System.Net",
        "System.Text"
      ],
      "type": "object",
      "required": [
        "username",
        "password"
      ],
      "Templates": {
        "NotUnderstood": {
          "Patterns": [
            "I do not understand, Please rephrase that"
          ]
        },
        "EnumSelectOne": {
          "Patterns": [
            "Choose one please"
          ],
          "ChoiceStyle": "Auto"
        }
      },
      "properties": {
        "username": {
          "Prompt": {
            "Patterns": [
              "Tell me the {&amp;}, please",
              "I need you to especify a {&amp;}, please"
            ]
          },
          "type": [
            "string",
            "null"
          ],
          "Templates": {
            "NotUnderstood": {
              "Patterns": [
                "That is not a valid input"
              ]
            }
          }
        },
        "password": {
          "Prompt": {
            "Patterns": [
              "Tell me the {&amp;}, please",
              "I need you to especify a {&amp;}, please"
            ]
          },
          "type": [
            "string",
            "null"
          ],
          "Templates": {
            "NotUnderstood": {
              "Patterns": [
                "That is not a valid input"
              ]
            }
          }
        }
      },
      "OnCompletion": "await context.PostAsync(\"Thank you!\"); string files = \"\"; context.PrivateConversationData.TryGetValue&lt;string&gt;(\"Files\", out files); [more code...]"
  
  }
  </code></pre>
  
  <p>`</p>
  
  <p>I need to send to the database the user's answers to the generated JObject/JSON form's questions, but so far, I haven't found a way to do that. </p>
  
  <p>I also tried accessing the BotData with this line <code>context.PrivateConversationData.TryGetValue&lt;string&gt;("Files", out files);</code>, so I could send the user's answers to the database directly from the <strong>"OnCompletion"</strong> section of the JSON, but still I can't seem to access to the botdata or context on the OnCompletion section.  </p>
  
  <p>Is there any other way I can successfully retrieve the user's responses to the JObject/JSON generated form after the user answers the last question in the form?</p>