【问题标题】:How can I read the value from complex adaptive card?如何从复杂自适应卡中读取值?
【发布时间】:2017-11-07 09:28:56
【问题描述】:

如果正文只有输入文本,我可以读取这些值。这种情况有列集和列。当我填写所有输入数据并单击模拟器中的提交按钮时,我没有得到任何值。

平台:.Net C#

下面我分享了json卡的详细信息。你能帮我解决这个问题吗?

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "0.5",
  "body": [
    {
      "type": "ColumnSet",
      "columns": [
        {
          "type": "Column",
          "size": 2,
          "items": [
            {
              "type": "TextBlock",
              "text": "Tell us about yourself...",
              "weight": "bolder",
              "size": "large"
            },
            {
              "type": "TextBlock",
              "text": "We just need a few more details to get you booked for the trip of a lifetime!",
              "isSubtle": true,
              "wrap": true
            },
            {
              "type": "TextBlock",
              "text": "Don't worry, we'll never share or sell your information.",
              "isSubtle": true,
              "wrap": true,
              "size": "small"
            },
            {
              "type": "TextBlock",
              "text": "Your name",
              "wrap": true
            },
            {
              "type": "Input.Text",
              "id": "myName",
              "placeholder": "Last, First"
            },
            {
              "type": "TextBlock",
              "text": "Your email",
              "wrap": true
            },
            {
              "type": "Input.Text",
              "id": "myEmail",
              "placeholder": "youremail@example.com",
              "style": "email"
            },
            {
              "type": "TextBlock",
              "text": "Phone Number"
            },
            {
              "type": "Input.Text",
              "id": "myTel",
              "placeholder": "xxx.xxx.xxxx",
              "style": "tel"
            }
          ]
        },
        {
          "type": "Column",
          "size": 1,
          "items": [
            {
              "type": "Image",
              "url": "https://upload.wikimedia.org/wikipedia/commons/b/b2/Diver_Silhouette%2C_Great_Barrier_Reef.jpg",
              "size": "auto"
            }
          ]
        }
      ]
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit"
    }
  ]
}

【问题讨论】:

  • 我不完全确定,但是我上次尝试使用自适应卡时,提交操作不适用于列集,也许你可以删除所有列并测试它是否适合您
  • 如果我删除列集,它将起作用,但我尚未测试。我想从列集中得到结果
  • 那么也许你可以试试Action.Http而不是Action.Submit,并使用像“key=value&key2=value2”这样的body
  • 这是我们几周前在 HTML 渲染器中修复的错误,但似乎不在您的 WebChat 控件/模拟器版本中。我将研究如何更新构建
  • 你是说message.Value是空的?

标签: c# .net botframework adaptive-cards


【解决方案1】:

如果有人看到这个问题,为了清楚起见,这是一个很老的问题,

根本问题在很久以前就已修复,如果您正在使用这样的 AdaptiveCards,那么无论这些值是否在列集中,您都可以很好地获得所有值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-08
    • 2020-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多