I have this JSON:
[
{
"ParentReasonId": 2,
"ParentReason": "Violent or repulsive content",
"ReasonId": 15,
"Reason": "Adults fighting"
},
{
"ParentReasonId": 2,
"ParentReason": "Violent or repulsive content",
"ReasonId": 16,
"Reason": "Physical attack"
}
]
With azure logic apps i'm trying to transform the array into a json of two arrays:
{
"categories": [
{
"categoryId": 2,
"category": "Violent or repulsive content"
}
],
"reasons": [
{
"categoryId": 2,
"reasonId": 15,
"reason": "Adults fighting"
},
{
"categoryId": 2,
"reasonId": 16,
"reason": "Physical attack"
}
]
}
How can i achieve this using azure logic apps? The data is coming from a sql stored procedure action.
ParentReasonIdandParentReasonwould be mapped to the categories array. There could be more array items but in the original array, both array items have the sameParentReasonIdandParentReasonso they would get grouped together in the categories array. Then theParentReasonId,ReasonIdandReasonwould be grouped to the reasons array. - joey0xxcategorybeViolent or repulsive content? - PramodValavala-MSFT