Steve Moro
Steve Moro

Reputation: 83

How to remove section in JSON in LogicApp

enter image description here

Compose - removeProperty(variables('Message')['Appointment'],'CustomerInfo')

enter image description here

What I want to see if the following. enter image description here

Upvotes: 1

Views: 747

Answers (2)

Skin
Skin

Reputation: 11197

I managed to recreate your issue without drama and unfortunately, I couldn't find a way to use the removeProperty function to make it work.

You have to call the function at the level it expects so it can remove a single named property and therefore, it only returns the level the function is called at which is, obviously, a problem.

This may not be the approach for you but to overcome this shortcoming, I used the inline Javascript action to do the work.

Flow

If you've never used the action before, you need to make sure set you flow up to use an Integration account. You can get one in the free tier so it doesn't cost you anything but may be limiting depending on the workload AND it's not supported for production workloads.

https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-create-integration-account?tabs=azure-portal%2Cconsumption

This did give me the desired outcome though ...

Result

Upvotes: 1

RithwikBojja
RithwikBojja

Reputation: 11183

Firstly, I have initialized variable and then used compose action with removeproperty(variables('emo')['appointment'],'customerInfo') as below:

enter image description here

Then I again used compose as below with removeproperty(variables('emo'),'appointment'):

enter image description here

Then I used Compose 3 for combing both composes as below using union(outputs('Compose_2'),outputs('Compose')) :

enter image description here

Output:

enter image description here

enter image description here

OR: If you have integrated account Reference. Hope this clears all your doubts.

Upvotes: 0

Related Questions