【问题标题】:"IsRequired" not working for Input.Text of Adaptive Card in MsTeams“IsRequired”不适用于 MsTeams 中自适应卡片的 Input.Text
【发布时间】:2021-01-15 00:31:31
【问题描述】:

我正在尝试添加必需验证来检查评论框是否为空。我检查了多个地方和博客以使其正常工作,但有些验证在 Teams 中根本不起作用。当我使用自适应卡设计器时,它按预期工作。

以下是我在团队机器人中使用的 JSON 代码。

{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [
           {
        "type": "Input.Text",
        "label": "Comments",
        "style": "text",
        "isMultiline": true,
        "id": "MultiLineVal",
        "isRequired": true,
        "errorMessage": "required"
    }
],
"actions": [
    {
        "type": "Action.Submit",
        "title": "Submit"
    }
]

}

设计师屏幕抓取

【问题讨论】:

    标签: botframework microsoft-teams adaptive-cards


    【解决方案1】:

    查看 this reference on input validation 并注意它指的是 Adaptive Cards 1.3 及更高版本,而正如 here 所解释的,Teams 目前有点落后,仅支持 Adaptive Cards 1.2。这些产品虽然相关,但不同并且具有不同的发布周期 - 希望 1.3 很快就会出现在 Teams 中。

    【讨论】:

      猜你喜欢
      • 2018-11-10
      • 2021-08-30
      • 2020-04-28
      • 1970-01-01
      • 2021-05-06
      • 2019-08-19
      • 2022-12-14
      • 2020-11-14
      • 2020-07-29
      相关资源
      最近更新 更多