存储在变量中的json的逻辑应用程序读取属性 [英] Logic app read property of json stored in variable

查看:34
本文介绍了存储在变量中的json的逻辑应用程序读取属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Logic App变量中包含此json.我想对该JSON的'id'属性进行进一步的使用.如何获取此id属性值?

I have this json in a Logic App variable. I want to 'id' property of this JSON and use further. How to get this id property value?

我的json是:

{
"id": 1,
"name": "John bright",
"username": "Lily",
"email": "abc@aabc.com",
}

推荐答案

您说您的json是变量,但是您没有提及它存储的类型.

You said your json is a variable, but you don't mention which type it's stored.

  1. 存储为字符串.这样,整个json是一个字符串,不支持select属性.因此,您需要使用 Parse JSON 动作将其解析为Json,然后才能选择属性.关于 Parse JSON 架构,只需单击使用样本有效负载生成架构并粘贴您的json值,它将生成.然后选择您的媒体资源,只需使用 @ {body('Parse_JSON')?['name']} ,即可使用.
  1. Stored as string. In this way the whole json is a string, it's not supported to select property. So you need parse it to Json with Parse JSON action then you will be able to select property. About the Parse JSON Schema, just click the Use sample payload to generate schema and paste your json value, it will generate. And select your property just use the @{body('Parse_JSON')?['name']}, it will work.

  1. 如果将其存储为对象,则更容易实现,只需使用表达式 variables('test1')['name'] 即可获取.

这篇关于存储在变量中的json的逻辑应用程序读取属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆