How to display adaptive card selected option as if the user typed it in?

放肆的年华 提交于 2020-07-09 12:10:20

问题


By default when we use adaptive cards in a waterfall dialog, the bot records the selected action and process the next waterfall step - how it actually looks

Instead can we display the selected option in the adaptive card as if the user typed in the option like - What I want it to look like

I have a requirement where we want to display it as if the user typed it in and not like the bot says "you selectd X option".


回答1:


You can do this by using the 'data' property in your Adaptive Card.

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
      {
        "type": "TextBlock",
        "spacing": "medium",
        "size": "small",
        "weight": "bolder",
        "text": "",
        "wrap": true,
        "maxLines": 0
      },
      {
        "type": "Container"
      }
    ],
    "actions": [
      {
        "type": "Action.Submit",
        "title": "Policy",
        "data": "Policy"
      },
      {
        "type": "Action.Submit",
        "title": "Scheduled",
        "data": "Scheduled"
      }
    ]
}


来源:https://stackoverflow.com/questions/62410129/how-to-display-adaptive-card-selected-option-as-if-the-user-typed-it-in

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!