web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / extract XML data using...
Power Automate
Unanswered

extract XML data using power automate

(0) ShareShare
ReportReport
Posted on by 7

I currently have a flow that will read my XML data and populate this to a SharePoint list

 

The flow uses XML in the format of:

 

 

 

<Document>
 <Attributes>
 <PIRRef>54045</PIRRef>
 <InvoiceDate>22/05/2014</InvoiceDate>
 <NetAmount>1,746.96</NetAmount>
 </Attributes>
</Document>

 

 

 

 

then using another Compose I have the following:

 

 

 

 

xpath(xml(outputs('Compose')),'/Document/Attributes')

 

 

 

 

I then use an apply to each to create a SharePoint list item for each Document record in the XML data using the following to compose each attribute in the list: (a new compose is used for each attribute)

 

 

 

 

xpath(xml(item()),'string(/Attributes/PIRRef)') 

 

 

 

 

  Then finally create a new item in the list using the outputs of each Compose function to populate each column in the list.

 

I now have a new set of XML data to process however the XML format is completely different and I'm unsure on how to extract the required values from the following XML without manually editing the records to match my current format, however I have over 40,000 Document records to process in this format.

 

 

 

 

 <Document Scheme="PurchaseInvoice" ID="0B807CEEF97411E4B64500505685156C" SchemeHash="FF298EE05B8622172077FD1E1100E20B">
 <Attributes>
 <NamedDV Name="PIRRef" ID="30ADFF586B6BE26316619C294DFEC637">
 <Value Encoding="UTF-8" Type="TEXT" Locale="en-GB">42103</Value>
 </NamedDV>
 <NamedDV Name="InvoiceDate" ID="5C0491A99EC233C72FEB9C205A0F1D5B">
 <Value Encoding="UTF-8" Type="DATE" Plain="@20100107000000" Locale="en-GB" Millis="0">07/01/2010</Value>
 </NamedDV>
 <NamedDV Name="NetAmount" ID="9C7E756656A4DE19FC3209DC4C94BD66">
 <Value Encoding="UTF-8" Type="DECI" Plain="@150" Locale="en-GB">150</Value>
 </NamedDV>
 </Attributes>
</Document>

 

 

 

 

Any help is greatly appreciated.

 

Thanks

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    Seems reasonably straightforward, I just had a quick play with the XML data you provided. what attributes are you looking for? I presume you also want to transform it to JSON?

     

    What would be ideal is if you could take the example above, and write out what JSON you'd like to see, then I can put something together to help you.

  • markbyrne Profile Picture
    7 on at

    Apologies, I did mean to respond to your comment.  I actually ended up using XSL to transform the data as required and was then able to build a simple flow to handle the files.

     

    Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard