问题
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