I am working in a logic app that retrieve values from an XML. I was working initially with this XML structure:
<Parent>
<Child1>Hello</Child1>
<Child2>World</Child2>
</Parent>
And I was able to retrieve the values by using this XPath expression (this is inside of a For_Each action):
"@{xpath(xml(items('For_each_node')), 'string(/*[local-name()=\"Parent\"]/*[local-name()=\"Child1\"])')}"
It works great and I get 'Hello' in this example, however I've been given now this XML:
<Parent>
<Child N="1">Hello</Child>
<Child N="2">World</Child>
</Parent>
And now the expression placed above retrieves nothing. I think I need to adjust the expression to do something like 'retrieve node value where child attribute equals 1' but I am not able to make it work, I've seen examples on how to do that but somehow the syntax used in Logic apps for XPath is kind of different as how 'standard' XPath is used.
I would appreciate your help, thanks!