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
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
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.
stampcoin
103
Michael E. Gernaey
82
Super User 2025 Season 1
David_MA
60
Super User 2025 Season 1