【问题标题】:How to get a TextBlock Text via Action.Http?如何通过action.http获取TextBlock文本?
【发布时间】:2021-01-23 10:43:03
【问题描述】:

我正在尝试在单击发送反馈时获取 TextBlock 文本/值(“单击了解更多以了解有关可操作消息的更多信息!)作为响应。 我尝试了 {{Heading.text}}{{Heading.value}},其中 Heading 是字段的 id。

Adaptive Card

通过 {{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"}

感谢您的帮助。

【问题讨论】:

    标签: adaptive-cards


    【解决方案1】:

    我在尝试在 http 正文中发送文本块的值时遇到了同样的问题。我使用了以下解决方法:

    1. 创建了 Input.Number 字段
    2. 将 Initially Visible 属性设置为 false
    3. 撰写自适应卡片时,我使用逻辑应用程序/流来填充字段的值
    4. 然后将 Action.Http 设置为输入框的 id.value 值。

    【讨论】:

      猜你喜欢
      • 2011-05-05
      • 1970-01-01
      • 2011-05-18
      • 1970-01-01
      • 2017-01-13
      • 2016-02-06
      • 2016-09-13
      • 2020-09-07
      • 2013-07-10
      相关资源
      最近更新 更多