如何在azure逻辑应用程序内的团队连接器中获取消息详细信息的正文

问题描述 投票:0回答:1

photo of response

是否可以获取由 json 填充的字符串值的附件内容,并且我需要从输出中获取文本值('Get_message_details')?['body']['attachments'][0]?['content']我可以获取整个 json,但不知道 azure 逻辑应用程序内部如何从 ['content'] thnx

获取此文本

最后(分割(变量('messagesummary'),' ')) 尝试使用 last 和 split 函数来解析包含 ['content'] 值的 messagessummary

我需要获取此“时间 SLA 警报”

"body": {
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('-a1d4-')/channels('1read.skype')/messages/$entity",
    "id": "178",
    "replyToId": "1732848",
    "etag": "1732871025948",
    "messageType": "message",
    "createdDateTime": "2024-11-29T09:03:45.948Z",
    "lastModifiedDateTime": "2024-11-29T09:03:45.948Z",
    "lastEditedDateTime": null,
    "deletedDateTime": null,
    "subject": null,
    "summary": null,
    "chatId": null,
    "importance": "normal",
    "locale": "en-us",
    "webUrl": "https://teams.microsoft.com/l/message/19%3Acc47485597a7ae%40thread.skype/1tenantIbb6d-10f4&createdTime=173225948&parentMessageId=1732871025948",
    "policyViolation": null,
    "eventDetail": null,
    "from": {
        "device": null,
        "user": null,
        "application": {
            "@odata.type": "#microsoft.graph.teamworkApplicationIdentity",
            "id": "358f018a9ec87",
            "displayName": "Workflows",
            "applicationIdentityType": "bot"
        }
    },
    "body": {
        "contentType": "html",
        "content": "<attachment id=\"768f1fd\"></attachment>",
        "plainTextContent": ""
    },
    "channelIdentity": {
        "teamId": "5fe92",
        "channelId": "19:[email protected]"
    },
    "attachments": [
        {
            "id": "7685a1fd",
            "contentType": "application/vnd.microsoft.card.adaptive",
            "contentUrl": null,
            "content": "{\r\n  \"type\": \"AdaptiveCard\",\r\n  \"body\": [\r\n    {\r\n      \"color\": \"attention\",\r\n      \"size\": \"large\",\r\n      \"text\": \"\\n[FIRING] Time SLA alert\\n\",\r\n      \"weight\": \"bolder\",\r\n      \"wrap\": true,\r\n      \"type\": \"TextBlock\"\r\n    },\r\n    {\r\n      \"text\": \"\\nAnnotations:\\n - message = Time SLA in prod is below 97.5\\n\\nValue: B0=97.35300516227274\\n\\nGo to Dashboard: [https://xbns.azurewebsites.net/d/health-prod?orgId=1](https://xbbs.azurewebsites.net/d/health-prod?orgId=1)\\n\\nGo to Panel: [https://jkfjdalk.azurewebsites.net/d/health-prod?orgId=1&viewPanel=65](https://jdkljf.azurewebsites.net/d/health-prod?orgId=1&viewPanel=65)\\n\\n\",\r\n      \"wrap\": true,\r\n      \"type\": \"TextBlock\"\r\n    },\r\n    {\r\n      \"actions\": [\r\n        {\r\n          \"url\": \"https://kjfdlkafj.azurewebsites.net/alerting/list\",\r\n          \"title\": \"View URL\",\r\n          \"type\": \"Action.OpenUrl\"\r\n        }\r\n      ],\r\n      \"type\": \"ActionSet\"\r\n    },\r\n    {\r\n      \"items\": [\r\n        {\r\n          \"size\": \"small\",\r\n          \"text\": \"xyx Workflow template to send this card. [Get template](https://teams.microsoft.com/l/task/c3?url=https%3A%2F%2Fmake.powerautomate.com%2Fteams%2Fstore%2FflowCreatf)\",\r\n          \"weight\": \"lighter\",\r\n          \"wrap\": true,\r\n          \"type\": \"TextBlock\"\r\n        }\r\n      ],\r\n      \"separator\": true,\r\n      \"type\": \"Container\"\r\n    }\r\n  ],\r\n  \"version\": \"1.2\",\r\n  \"msTeams\": {\r\n    \"width\": \"full\"\r\n  }\r\n}",
            "name": null,
            "thumbnailUrl": null,
            "teamsAppId": null
        }
    ],
json string parsing azure-logic-app-standard
1个回答
0
投票

您需要在使用

outputs('Get_message_details')?['body']['attachments'][0]?['content']
表达式检索整个 Json 字符串后使用给定的流程。

获取 Json 字符串值后,添加解析 JSON 操作,然后添加撰写操作。

Parse Json 操作将 Json 字符串的值作为输入。

enter image description here

在撰写操作中发布此使用

outputs('Parse_JSON')?['body']?['body'][0]?['text']
表达式以获得所需的结果。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.