Looking forward to an approach to convert simple JSON objects to Key value pair JSON objects using Logic Apps.
Like:
{
"FirstName": "ABC",
"LastName": "123",
"MiddleName": null,
}
to
[
{
"Key": "FirstName"
"Value": "ABC"
},
{
"Key": "LastName"
"Value": "123"
}
]
Thanks for the suggestions.
2
Answers
I have followed the below steps to convert JSON Object to Key-Value pair JSON Objects-
I have taken
triggerBody()
in the Content fieldHere Schema is
After the Parse JSON action, add a Compose action.
Enter the following expression in the Inputs field of the Compose action
Output–
Check in the Runs History
As per my comment, you should (could) look at using the
Advanced Data Operations
connector, it has an operation which is specifically designed to complete your requirement.https://learn.microsoft.com/en-us/connectors/advanceddataoperatio/
https://www.statesolutions.com.au/json-properties-to-name-value-pair-array/
This is the resulting JSON it will give back …