[英]Azure Logic Apps - Map Json to Json with Liquid flatten array
Any help would be much appreciated. 任何帮助将非常感激。 What I am trying to achieve is to request a record from Dynamics 365(cloud) to an on-premise system (exposed by mulesoft) I have decided to use Azure logic apps to do the integration and to use Liquid to do the mapping, however I am battling to flatten the array with liquid, I'm getting a JSON payload from the on-premise system which I need to transform readily to load into dynamics 365, what I am getting is something like the following:
我想要实现的是从Dynamics 365(cloud)到本地系统(由mulesoft公开)请求记录,我决定使用Azure逻辑应用程序进行集成并使用Liquid进行映射,但是我正在努力用液体将阵列弄平,我从本地系统中获取JSON负载,我需要对其进行轻松转换以加载到Dynamics 365中,得到的内容如下所示:
{
"person": {
"firstname": " Fred",
"surname" : "Smith",
"age": 27,
"phoneno":"123456789",
"addresses": [
{
"address": {
"AddressLine1":"1 milky way",
"AddressLine2":"galaxy cresent",
"city": "tempest",
"state": "Idiho",
"postcode": "12345"
}
},
{
"address": {
"AddressLine1":"52 Saturn Drive",
"AddressLine2":"Wharfridge",
"city": "tempest",
"state": "Idiho",
"postcode": "12345"
}
}
]
}
}
and what I need is to flatten the array into the root node like this: 我需要的是将数组展平到根节点,如下所示:
{
"person": {
"firstname": " Fred",
"surname" : "Smith",
"age": 27,
"phoneno":"123456789",
"addr1_AddressLine1":"1 milky way",
"addr1_AddressLine2":"galaxy cresent",
"addr1_city": "tempest",
"addr1_state": "Idiho",
"addr1_postcode": "12345",
"addr2_AddressLine1":"52 Saturn Drive",
"addr2_AddressLine2":"Wharfridge",
"addr2_city": "tempest",
"addr2_state": "Idiho",
"addr2_postcode": "12345"
}
}
If there any other solutions\\ideas, i am all ears. 如果还有其他解决方案/想法,我全神贯注。
Thanks in advance for your help Paul 预先感谢您的帮助Paul
So i found a solution or rather a work around, for some reason the liquid connector in logic apps does not support the "increment" tag, this was causing my issue. 所以我找到了一个解决方案,或者说是一个变通办法,由于某种原因,逻辑应用程序中的液体连接器不支持“ increment”标签,这导致了我的问题。 i was able to evaluate a property form the input json to decide where my fields would reside.
我能够评估输入json的属性来决定我的字段将驻留在哪里。 but thanks for
但是谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.