Parsed Message { "date": "2022-02-04", "customerID": 123, "customerInfo": { "id": 123, "lastname": "Smith", "firstname": "David", "email": "[email protected]", }, "currency": "EUR" }
I would like to remove the customerInfo section so the JSON looks like. { "date": "2022-02-04", "customerID": 123, "currency": "EUR" }
How would one do this in the LogicApp. I tried remove property but could not get that working. Any suggestions would be appreciated.
CodePudding user response:
You just initialize new variable from that one and populate it
"Initialize_variable": {
"type": "InitializeVariable",
"inputs": {
"variables": [ {
"name": "sensitisedMessage",
"type": "Object",
"value": { "date": @message['date'], "customerID": @message['customerID'], "currency": "@message['currency']" }
} ]
},
"runAfter": {}
}
I have not checked the format of the json in an actual logic app, but you get the idea
CodePudding user response:
I have reproduced in my environment and removed customer info using remove property as below :
Firstly, I have initialized a variable as below:
Then I used compose operation as below:
In compose input: removeProperty(variables('emo'),'customerInfo')
Then i have set the variable with output of compose as below:
Output:
Try to follow above process you will get to remove customerInfo as mine got.