Search code examples
jsonbotframeworkazure-language-understandingadaptive-cards

json file formatting correctly, so LUIS can read the data


My program can read Intents from LUIS correctly and launch other adaptive cards using LUIS Intents, however with this column type, still is not possible. The Intents am trying to launch here are "user" and "myEmail" in "type": input.text. I know somehow the data field in json must be misplaced, or the title, or id. Here´s the file, any help...?

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
    {
      "type": "Image",
      "url": "lalala.png",
      "size": "Medium"
    },
    {
      "type": "ColumnSet",
      "columns": [
        {
          "type": "Column",
          "width": 2,
          "items": [
            {
              "type": "TextBlock",
              "text": "Einloggen",
              "weight": "Bolder",
              "size": "Medium"
            },
            {
              "type": "Input.Text",
              "id": "myName",
              "title": "user",
              "data": "user",
              "placeholder": "Benutzername oder email"
            },
            {
              "type": "Input.Text",
              "id": "myEmail",
              "title": "myEmail",
              "data": "myEmail",
              "placeholder": "Passwort",
              "style": "Email"
            }
          ]
        }
      ]
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit"
    },
    {
      "type": "Action.Submit",
      "title": "Cancel"
    }
  ]
}

Solution

  • Thanks for the suggestions, didn´t read before https://blog.botframework.com/2019/07/02/using-adaptive-cards-with-the-microsoft-bot-framework/ were the problem between action submit and data is better specified.

        {
          "type": "ColumnSet",
          "columns": [
            {
              "type": "Column",
              "width": 2,
              "items": [
                {
                  "type": "TextBlock",
                  "text": "Einloggen",
                  "weight": "Bolder",
                  "size": "Medium"
                },
                {
                  "type": "Input.Text",
                  "id": "myName",
                  "title": "user",
                  "placeholder": "Benutzername oder email"
                },
                {
                  "type": "Input.Text",
                  "id": "myEmail",
                  "title": "myEmail",
                  "placeholder": "Passwort"
    
                }
    
              ]
            }
          ]
        }
      ],
      "actions": [
        {
          "type": "Action.Submit",
          "title": "Submit",
          "data": {
            "myName": true,
            "myEmail": true
          }
        }
    
    
      ] }