[
{
"@odata.etag": "",
"ItemInternalId": "bf73ba98-d392-424c-9dc1-f2be44e9d431",
"Name": "Shuvendu",
"Dept": "Developer"
},
{
"@odata.etag": "",
"ItemInternalId": "3de1725d-d7cb-45fa-9855-713bbf8fdc23",
"Name": "Debashish",
"Dept": "DBA"
}
]
This is my request body i want ro ignore "@odata.etag"
and
"ItemInternalId"
from the next operation in logic app I mean to say whatever the field like "Name","Dept" like this these field will be increase dynamically whatever the new field added those are needed but i want to ignore above those field
body('List_rows_present_in_a_table')?['value']
this is the body above arrey is the body element
expecting output
[
{
"Name": "Shuvendu",
"Dept": "Developer"
},
{
"Name": "Debashish",
"Dept": "DBA"
}
]
my main intention to remove those field dynamically so whatever the input body that contain "@odata.etag"
and "ItemInternalId"
thesse should be removed and display rest as output
i want this functionality in azure logic apps
body('List_rows_present_in_a_table')?['value']
this is the body from the above action enter image description here
[
{
"Name": "Shuvendu",
"Dept": "Developer"
},
{
"Name": "Debashish",
"Dept": "DBA"
}
]
expecting this output
3
Answers
I have achieved your requirement in the following way-
Schema:
Getting the output as below-
You need to Parse_JSON before performing Compose action in order to get the individual property value from a json.
Try using removeProperty expression
original json:
updated json:
more info and examples here:
https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#removeProperty
You could do it a couple of other ways if you’re interested. One of which is the
Select
operation.Select
Using a
Select
operation from the set ofData Operations
actions, you can pick out what you want from the entire array without needing to add all of the operations for looping.Flow
Step Definition
Result
Depending on how dynamic your JSON could be, this may not be the best option because if a new field comes in, it will need to be mapped.
If you wanted to take it a step further, the
Advanced Data Operations
connector will do it for you without looping and dynamically selecting the relevant fields. The structure could change and the logic will make sure the new fields are included.