[英]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请求之前,我似乎遇到了内容类型问题,让我在步骤中进行解释。
{ "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 %} ] }
{ "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.