cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,102)