adaptive-cards - 如何通过 Action.Http 获取 TextBlock 文本?
问题描述
单击发送反馈时,我试图获取 TextBlock 文本/值(“单击了解更多以了解有关可操作消息的更多信息!)作为响应。我尝试了 {{Heading.text}}和{{Heading.value}},标题为 id的一个领域。
通过{{feedbackText.value}}从Input.Text获取价值就可以了。
样本:
{
"type": "AdaptiveCard",
"version": "1.0",
"hideOriginalBody": true,
"body": [
{
"type": "TextBlock",
"text": "Visit the Outlook Dev Portal",
"size": "Large"
},
{
"type": "TextBlock",
"text": "Click **Learn More** to learn more about Actionable Messages!",
"id": "Heading"
},
{
"type": "Input.Text",
"id": "feedbackText",
"placeholder": "Let us know what you think about Actionable Messages"
}
],
"actions": [
{
"type": "Action.Http",
"title": "Send Feedback",
"method": "POST",
"url": "https://webhook.site/.....",
"body": "{{feedbackText.value}}\n{{Heading.text}}\n{{Heading.value}}"
},
{
"type": "Action.OpenUrl",
"title": "Learn More",
"url": "https://docs.microsoft.com/outlook/actionable-messages"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"}
感谢帮助。
解决方案
我在尝试在 http 正文中发送文本块的值时遇到了同样的问题。我使用了以下解决方法:
- 创建了一个 Input.Number 字段
- 将 Initially Visible 属性设置为 false
- 撰写自适应卡时,我使用逻辑应用程序/流来填充字段的值
- 然后将 Action.Http 设置为输入框的 id.value 值。
推荐阅读
- set - CPLEX OPL 返回具有条件的集合索引
- keras - 在 python 中创建 Keras 层的树结构
- angular - 登录表单成功时隐藏模式
- ios - 自托管 Signal iOS 无法连接到互联网
- android - React 本机拆分的 APK 文件未安装
- ios - React Native 中的多个 WebView
- gitlab - Gitlab 没有活跃的跑步者。为什么
- xml - XSL 生成嵌套列表 - 项目重复
- ruby-on-rails - '!= render' 的目的是什么?
- c# - TCPListener 在 listener.EndAcceptTcpClient(asyncResult) 上抛出 Socket 异常