I have an XML in logic app like below:
<JournalCollection>
<Journal>
<ChangeCode>
<Code>a1</Code>
</ChangeCode>
</Journal>
<Journal>
<ChangeCode>
<Code>b1</Code>
</ChangeCode>
<Description>Description</Description>
</Journal>
<Journal>
<ChangeCode>
<Code>c1</Code>
</ChangeCode>
</Journal>
</JournalCollection>
I need to add "Description" field only for the Code = b1. I have the position of that in a variable but I am not able to use json path expression as I see this is not supported in logic apps:
Adding a variable in json path expression to set the position value throws this error:
I also tried using transform XML shape but since I need to check the position of a child element in the destination schema, I am not able to update it.
Is there any way we can update an XML for a sub-child node based on another sub-child node value in logic apps?
JSON Path isn't supported natively in Java (or any language that I'm aware of). You'll need a JSON Path processor, like Jayway. You'll likely need to give the library the path as a string, then it will parse the path and give you the result you're looking for.
I'm not sure how you would go about including external libs in the context of an Azure Logic App, though.