I am currently trying to iterate through a XML file and get the data using Microsoft Flow.
I cannot figure out how to iterate through multiple XML elements. Please see below example.
This is my XML data:
<?xml version="1.0" encoding="utf-8"?> </ShipmentProfileReport> <ShipmentProfileReportItem> <JobOperator>John Doe</JobOperator> <Master>17231888581</Master> </ShipmentProfileReportItem> <ShipmentProfileReportItem> <JobOperator>Jane Doe</JobOperator> <Master>78423082032</Master> </ShipmentProfileReportItem> </ShipmentProfileReport>
I wish to iterate through all
<ShipmentProfileReportItem>
items, and get:
<JobOperator> <Master>
This is my flow:
XML (ShipmentProfileReportItem):
xpath(xml(outputs('XML_File')),'//ShipmentProfileReportItem')
Compose 2 (Inside foreach):
xpath(xml(item()),'string(.)')
This returns:
John Doe 17231888581
And
JaneDoe 78423082032
However above is just returned as above string. I want to update a sharepoint list. My question is: How can I access the lines seperately? For example:
xpath(xml(item("Master")),'string(.)') xpath(xml(item("JobOperator")),'string(.)')