如何从复杂的自适应卡片中读取数值?

4

如果表单中只有文本输入,我可以读取数值。但是这个表单有列集和列。当我填写所有输入数据并从仿真器点击提交按钮时,我没有得到任何值。

平台:.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"
    }
  ]
}

我不是完全确定,但上次我尝试使用自适应卡片时,提交操作与列集合不兼容,也许您可以删除所有列并测试是否适用于您。 - Kien Chu
如果我删除列集,它将起作用,但我还没有测试。我想从列集中获取结果。 - max
你可以尝试使用Action.Http而不是Action.Submit,并且像"key=value&key2=value2"这样使用body。 - Kien Chu
2
这是几周前我们在HTML渲染器中修复的一个错误,但似乎不在您的WebChat控件/仿真器版本中。我会研究如何更新构建。 - Matt Hidinger
你是说 message.Value 是空的吗? - Ezequiel Jadib
显示剩余2条评论
1个回答

0

这是一个比较老的问题,只是为了澄清,如果有人看到这个问题,

根本问题在相当长的时间前就已经解决了,如果你正在使用 AdaptiveCards,并且无论这些值是否在列集中,你都可以很好地获取所有的值。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接