You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Azure Logic Apps中提取Teams连接器消息详情的指定文本

在Azure Logic Apps中提取Teams消息附件里的"Time SLA alert"文本

方法一:解析JSON字符串(推荐)

你当前获取到的outputs('Get_message_details')?['body']['attachments'][0]?['content']是JSON格式的字符串,先通过json()函数将其转换为可直接访问的JSON对象,再根据实际的JSON结构提取目标文本:

json(outputs('Get_message_details')?['body']['attachments'][0]?['content'])?['目标字段名']

举个例子,如果你的JSON结构里"Time SLA alert"存放在title字段下,表达式就是:

json(outputs('Get_message_details')?['body']['attachments'][0]?['content'])?['title']

如果文本嵌套在sections数组的activityTitle字段中,就调整为:

json(outputs('Get_message_details')?['body']['attachments'][0]?['content'])?['sections'][0]['activityTitle']

注意:请替换成你实际JSON结构中对应"Time SLA alert"的字段路径。

方法二:字符串拆分(备选)

如果JSON解析操作有阻碍,可直接对获取到的字符串做拆分处理。若"Time SLA alert"处于字符串的最后一行,需根据换行符类型调整表达式:

  • 针对Unix换行(\n):
last(split(outputs('Get_message_details')?['body']['attachments'][0]?['content'], '\n'))
  • 针对Windows换行(\r\n):
last(split(outputs('Get_message_details')?['body']['attachments'][0]?['content'], '\r\n'))

内容的提问来源于stack exchange,提问作者Nela Kolundzija

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 00:15:57