cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

How to use xpath to parse xml file to extract same attribute but different node element

I built a flow where it obtains XML files from a Document Library, then it parses the files inside each XML elements using xpath Expression and adds the info into a Sharepoint List. The problem is that there is an attribute called "Rfc" that is inside two node elements, which are "emisor" and "receptor". I can extract the info without problem using the xpath function from "emisor" node element, however i also want to extract "receptor" node as well. The xpath code i used is this one but does not work

 

xpath(xml(outputs('Parseo')), 'string(//Receptor[@Rfc])')

 

 

 Here is an example from the XML file content, the attribute marked with the arrow is the one i want : 

 

ejemplo parseo 1.pngejemplo parseo 2.png

 

And this is my flow:

 

ejemplo flujo 1.png

 

ejemplo flujo 2.png

 

ejemplo flujo 3.png

 

ejemplo flujo 4.png

 

Thanks for your support!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to use xpath to parse xml file to extract same attribute but different node element

Hi @avargas,

 

There is the document about XPath() function, there are more details about how to use it in Flow, hope it could help you:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#x...

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: How to use xpath to parse xml file to extract same attribute but different node element

Hi @avargas,

 

There is the document about XPath() function, there are more details about how to use it in Flow, hope it could help you:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#x...

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (7,319)