【问题标题】:Input Value Substitution Outlook Actionable Messages not passing value输入值替换 Outlook 可操作消息未传递值
【发布时间】:2021-05-29 12:07:21
【问题描述】:

所以我在 Microsoft Flow 中使用它在 Outlook 中生成可操作的电子邮件。 该卡本身可以正常工作并在 Outlook 中正确显示。问题是 Action.Http 的输入值替换。

它实际上是在传递“{{newVendorNames.value}}”、“{{newVendorDocs.value}}”和“{{existingVendorAction.value}}”,而不是我在自适应卡中输入的值。值都是字符串。

具体线路为"body": "{\"newVendorNames\":\"{{newVendorNames.value}}\",\"newVendorDocs\":\"{{newVendorDocs.value}}\",\"existingVendorAction\":\"{{existingVendorAction.value}}\"}"

我错过了什么吗?这是一个错误吗?

{
"type": "AdaptiveCard",
"originator":"ORIGINATOR ID",
"body": [
    {
        "type": "TextBlock",
        "size": "medium",
        "weight": "bolder",
        "text": "Month End Close - Response"
    },
    {
        "type": "TextBlock",
        "text": "In order to complete our month-end close, please go through any sections that apply for the current month.",
        "wrap": true
    }
],
"actions": [
    {
        "type": "Action.ShowCard",
        "title": "New Vendor",
        "card": {
            "type": "AdaptiveCard",
            "body": [
                {
                    "type": "TextBlock",
                    "text": "Complete this section **only if** a new vendor or vendors began work in the current month.",
                    "wrap": true,
                    "color": "attention",
                    "size": "medium"
                },
                {
                    "type": "Input.Text",
                    "id": "newVendorNames",
                    "placeholder": "Enter the names of the vendors that began work in the current month.",
                    "isMultiline": true
                },
                {
                    "type": "Input.Toggle",
                    "title": "I have an invoice/SOW/Contract,etc.",
                    "id": "newVendorDocs",
                    "valueOn": "Yes",
                    "valueOff": "No"
                }
            ]
        }
    },
    {
        "type": "Action.ShowCard",
        "title": "Existing Vendors",
        "card": {
            "type": "AdaptiveCard",
            "body": [
                {
                    "type": "TextBlock",
                    "text": "Complete this section **only if** an existing vendor has performed services in the current month.",
                    "wrap": true,
                    "color": "attention",
                    "size": "medium"
                },
                {
                    "type": "TextBlock",
                    "text": "Have all invoices, for work performed in the current month, been submitted to AP?",
                    "wrap": true
                },
                {
                    "type": "Input.ChoiceSet",
                    "choices": [
                        {
                            "title": "Yes all invoices have been submitted.",
                            "value": "No"
                        },
                        {
                            "title": "No they have not been submitted and I have a copy of the invoice(s).",
                            "value": "Obtain invoices."
                        },
                        {
                            "title": "No they have not been submitted, I do not have a copy but I can estimate the cost.",
                            "value": "Dept owner can estimate accrual."
                        },
                        {
                            "title": "No they have not been submitted, I do not have a copy and I cannot estimate the cost.",
                            "value": "Dept owner cannot estimate accrual."
                        }
                    ],
                    "id": "existingVendorAction",
                    "style": "expanded"
                }
            ]
        }
    },
    {
        "type": "Action.Http",
        "title": "Submit Response",
        "method": "POST",
        "headers": [
            {
                "name": "Authorization",
                "value": ""
            },
            {
                "name": "Content-Type",
                "value": "application/json"
            }
        ],
        "url": "https://logic.azure.com:443/DELETED",
        "isPrimary": true,
        "body": "{\"newVendorNames\":\"{{newVendorNames.value}}\",\"newVendorDocs\":\"{{newVendorDocs.value}}\",\"existingVendorAction\":\"{{existingVendorAction.value}}\"}"
    }
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"

}

【问题讨论】:

  • 答案对您有用吗?我整个星期都在用同样的问题把头撞在桌子上。添加 \n 的解决方案对我不起作用

标签: json power-automate adaptive-cards


【解决方案1】:

试试这个 JSON:

"body": "{\n\"newVendorNames\": \"{{newVendorNames.value}}\",\n\"newVendorDocs\": \"{{newVendorDocs.value}}\",\n\"existingVendorAction\": \"{{existingVendorAction.value}}\"\n}"

你忘记了\n

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-09-07
    • 2020-04-17
    • 2021-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多