how to create new json object using compose connector in logic app without change in order?

拟墨画扇 提交于 2020-02-02 17:41:12

问题


I have logic app and created a json payload into compose connector but after save it is coming as asc order

How can I maintain a order

original json is -

{
"mainId":"2323",
"address":"DC"
}

But after save this it automatically coming it as -

{
"address":"DC",
"mainId":"2323"
}

回答1:


If you just compose the data, it will show asc order cause JavaScript JSON libraries default to alphabetical ordering of properties. So this is an expected behaviour that shouldn't have side effects if you stick to the JSON format. In other scenarios, like converting to XML.

If you insist on the custom order you could try with my. I create the json format string then compose it or parse it to json.

You could try compose or parse json action, they all could work. Hope this could help you.



来源:https://stackoverflow.com/questions/56940718/how-to-create-new-json-object-using-compose-connector-in-logic-app-without-chang

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!