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

在Logic App中动态访问嵌套JSON属性的语法问题

解决Logic App动态访问JSON嵌套属性的语法错误问题

问题根源

你当前使用的表达式存在语法错误:

body('Send_an_HTTP_request_to_SharePoint')?['value']?[variables('i')]?['variables('ColumName')']

错误点在于:

  • 动态列名变量variables('ColumnName')被错误地用单引号包裹,导致Logic Apps将其解析为字符串字面量而非变量值
  • 内部单引号'ColumName'与外部单引号冲突,直接触发语法解析失败

正确表达式写法

去掉变量外层的单引号,直接将变量作为键名传入方括号:

body('Send_an_HTTP_request_to_SharePoint')?['value']?[variables('i')]?[variables('ColumnName')]

补充说明

  1. 确保variables('ColumnName')已正确存储从POST请求中获取的列名字符串(比如"ColumnName")
  2. 提取Id和Title时,可在表达式后继续链式访问:
    • 获取Id:body('Send_an_HTTP_request_to_SharePoint')?['value']?[variables('i')]?[variables('ColumnName')]?['Id']
    • 获取Title:body('Send_an_HTTP_request_to_SharePoint')?['value']?[variables('i')]?[variables('ColumnName')]?['Title']
  3. 如果需要在Parse JSON操作中使用该动态结果,可先将上述表达式的输出作为Parse JSON的输入,再基于解析后的对象提取属性。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.13 08:07:14