Skip to main content

Notifications

Community site session details

Community site session details

Session Id : vRmodu4yap6HkEGmcQLY5D
Power Automate - Building Flows
Unanswered

extract XML data using power automate

Like (0) ShareShare
ReportReport
Posted on 9 Sep 2021 12:24:35 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

  • markbyrne Profile Picture
    7 on 14 Oct 2021 at 11:16:55
    Re: extract XML data using power automate

    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

  • Paulie78 Profile Picture
    8,407 Super User 2025 Season 1 on 09 Sep 2021 at 14:23:00
    Re: extract XML data using power automate

    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 103

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 60 Super User 2025 Season 1

Overall leaderboard
Loading started