首页 > 解决方案 > Teams 自适应卡在 Logic App 中等待响应

问题描述

我正在尝试自适应卡片,试图通过逻辑应用程序将警告与团队集成。我要问的问题与逻辑应用程序中的连接器在从逻辑应用程序发送后等待团队中自适应卡的响应有关。

我已经设法创建了我的自适应卡,并且在该卡中我有必要的信息和底部的两个操作,我希望我的逻辑应用程序可以这么说。

我的自适应卡看起来像这样:

{
"type": "AdaptiveCard",
"version": "1.0",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"body": [
    {
        "type": "TextBlock",
        "text": "Alert - Employee email differences found:",
        "weight": "Bolder",
        "size": "Medium",
        "horizontalAlignment": "Left",
        "spacing": "Medium",
        "maxLines": 0
    },
    {
        "type": "ColumnSet",
        "columns": [
            {
                "type": "Column",
                "width": "stretch",
                "items": [
                    {
                        "type": "TextBlock",
                        "text": "New Email",
                        "weight": "Bolder"
                    },
                    {
                        "type": "TextBlock",
                        "text": "Test.Person21@mail.com"
                    },
                    {
                        "type": "TextBlock",
                        "text": "Test.Person22@mail.com"
                    }
                ]
            },
            {
                "type": "Column",
                "width": "stretch",
                "items": [
                    {
                        "type": "TextBlock",
                        "text": "Old Email",
                        "weight": "Bolder"
                    },
                    {
                        "type": "TextBlock",
                        "text": "Test.Person11@mail.com"
                    },
                    {
                        "type": "TextBlock",
                        "text": "Test.Person12@mail.com"
                    }
                ]
            }
        ],
        "separator": true
    }
],
"actions": [
    {
        "type": "Action.Submit",
        "title": "Update Now",
        "style": "positive",
        "data": true
    },
    {
        "type": "Action.Submit",
        "title": "Dismiss",
        "style": "destructive",
        "data": false
    }
]
}

在此处输入图像描述

正如您所看到的,当我按下“立即更新”时,我收到一条错误消息,说“没有要连接的后端/应用程序”(瑞典语 - “无法访问应用程序,再试一次”)。

所以我再次尝试做的是让逻辑应用程序等待响应。在逻辑应用发送消息后,它“完成”。

那么这可能吗?如果是这样,我该如何让它工作?

标签: azure-logic-appsmicrosoft-teamsadaptive-cards

解决方案


虽然逻辑应用可以向 MS Teams 发送卡片,但它们无法监听在这些卡片上执行的操作。

为了能够使用卡片操作,您需要制作一个自定义服务来监听这些活动并对其采取行动。


推荐阅读