Hello.
I need to be able to extract some data from a XML file stored in SharePoint.
I am using the SharePoint Get File content action. It successfully reads the file. Here is a sample of the data
<?xml version="1.0" standalone="yes"?>
<DocumentElement>
<data>
<co>United States</co>
<department>Finance</department>
<division>Division Sample</division>
<displayName>User, Test</displayName>
<ID>123456</ID>
</data>
<data>
<co>United States</co>
<department>HR</department>
<division>Purchasing</division>
<displayName>Smith, John</displayName>
<ID>7891011</ID>
</data>
<data>
<co>United States</co>
<department>IT</department>
<division>Marketing</division>
<displayName>Bloggs, Joe</displayName>
<ID>13141516</ID
</data>
This is just a sample, this XML file has approx 60K records. I need to get the ID of each record and then compare that with another ID I have in another database. (i was hoping i could use a Condition to do this).
I have tried to use the following Expression body('XMLFile')?['DocumentElement']?['data']?['ID'] - but it throws back an error ".....cannot be evaluated because property 'data' cannot be selected".
I also tried using the xpath expression, like xpath(xml(triggerBody()?['XMLFile']),'string(//ID)') , this also throws back an error.
I have not used XML data before within PowerAutomate.
Can anyone please assist me?
Thanks