简体   繁体   English

无法在逻辑应用中使用液体从内容JSON检索数据

[英]Unable to retrieve data from content JSON using liquid in logic apps

I have a logic app that receives data from another logic app. 我有一个逻辑应用程序,可以从另一个逻辑应用程序接收数据。 Everything seems to work, and I see data coming in in the input, see image below. 一切似乎正常,我看到输入中有数据,请参见下图。 逻辑应用步骤的输入

After this, I try to transform it using liquid. 之后,我尝试使用液体对其进行转换。 This is my template: 这是我的模板:

液体模板

I know for a fact, that the liquid template does get applied. 我知道一个事实,液体模板确实得到应用。 See the image below, where you can see the liquid template structure being made and even adding the hardcoded strings as in the template. 请参见下图,您可以在其中看到液体模板的结构,甚至可以像模板中那样添加硬编码的字符串。 液体模板后的结果

As you can see, it seems I am unable to select the "Flights" array and even simple properties as these seem to be empty in the result json object. 如您所见,似乎我无法选择“ Flights”数组,甚至无法选择简单属性,因为这些属性在结果json对象中似乎为空。 Any idea why I could have this issue? 知道为什么我会有这个问题吗?

Seems like a content type issue to me before making http request, Let me explain it in the steps. 在发出http请求之前,我似乎遇到了内容类型问题,让我在步骤中进行解释。

  • Here is my liquid template which i tried: 这是我尝试过的液体模板:

  { "Employee Name" : "{{ content.firstname }} {{ content.lastname }}", "Company Name" : "{{ content.company }}", "Date Of Joining" : "{{ "now" | Date: "MM/dd/yyyy" }}", "Department" : "{{ content.department }}", "Technology" : "{{ content.work | Size }}", "Skills" : [ {% for Skill in content.work %} { "Name" : "{{ Skill.skil }}", "Marks" : {{ Skill.mark }} }, {% endfor %} ] } 

  • Here is my input file i was trying through postman: 这是我尝试通过邮递员输入的文件:

  { "firstname" : "Kamlesh", "lastname" : "Kumar", "company" : "Microsoft", "department" : "Interface Technology", "work" : [ { "skil" : "BizTalk Server", "mark" : 95 }, { "skil" : "Logic Apps", "mark" : 95 }, { "skil" : "Azure", "mark" : 85 }, { "skil" : "SQL Server", "mark" : 95 } ] } 

When i am making a http request from postman it gives me following result 当我从邮递员发出http请求时,它给了我以下结果

  { "Employee Name": " ", "Company Name": "", "Date Of Joining": "08/05/2019", "Department": "", "Technology": "0", "Skills": [] } 

which is you are getting it too. 您也正在得到它。 To resolve it i added type before hitting HTTP request by doing below 为了解决这个问题,我通过执行以下操作在到达HTTP请求之前添加了类型

在此处输入图片说明

and it worked for me. 它为我工作。 Please try and see if it work for you. 请尝试,看看是否适合您。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在逻辑应用程序中使用 Liquid Transform 将 Json 块分配给另一个 Json - Is it possible to assign chunks of Json to another Json using Liquid Transform in Logic Apps Azure Logic应用-使用Liquid Flatten数组将Json映射到Json - Azure Logic Apps - Map Json to Json with Liquid flatten array 使用逻辑应用修改 JSON 数据 - Modifying JSON Data using Logic Apps 逻辑应用程序 - 数据操作解析 JSON 不解析来自事件中心的内容 - Logic Apps - Data Operations Parse JSON not parsing Content from Event Hub 无法使用angularjs从json文件中检索数据 - unable to retrieve data from json file using angularjs 无法使用 javascript 从 html 页面中的 url 检索 JSON 数据 - Unable to retrieve JSON data from url in html page using javascript 无法使用jQuery从JSON文件检索数据 - Unable to retrieve data from JSON file using jQuery 在逻辑应用程序中检索Json属性的名称 - Retrieve the name of a Json property in logic apps 使用Azure Logic Apps将Json数据发布到Facebook时间线 - Post Json data to Facebook time line using Azure Logic Apps 在具有多个输入 JSON 源的 Azure 逻辑应用 Liquid Map 中执行 JSON 到 JSON 的转换 - To perform JSON-to-JSON Transformation in Azure Logic Apps Liquid Map with more than one input JSON sources
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM