cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aamato
Regular Visitor

Reading XML from List

First things first, I started using Power Automate around 6 hours ago so I am still very much new to this.

 

I am trying to create a flow that will go through my folder of DMARC reports (XML format), pull out the relevant data, then export everything into a CSV. I am able to open a single XML file, pull the information I am looking for, add it to a table, then write the table to CSV.

 

I am having issues with attempting this with multiple files. I am able to query the folder and generate a list of the xml files. I am unable to open the files from the list to read the xml. I am certain the issue is because I am trying to use a variable as opposed to a filepath, but I do not know how to specify the files any other way without manually adding each and every file.

 

Folder.GetFiles Folder: $'''FILEPATH:\\IT\\DMARC\\emailserver''' FileFilter: $'''*.xml''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> xml_files

XML.ReadFromFile File: xml_files Encoding: XML.FileEncoding.DefaultEncoding XmlDocument=> XmlDocument
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/report_metadata/org_name''' TextValue=> org_name
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/report_metadata/email''' TextValue=> email
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/report_metadata/report_id''' TextValue=> report_id
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/policy_published/domain''' TextValue=> domain
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/row/source_ip''' TextValue=> source_ip
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/row/count''' TextValue=> count
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/row/policy_evaluated/disposition''' TextValue=> disposition
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/row/policy_evaluated/dkim''' TextValue=> dkim
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/row/policy_evaluated/spf''' TextValue=> spf
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/identifiers/header_from''' TextValue=> header_from
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/auth_results/spf/domain''' TextValue=> spf_domain
XML.GetXmlElementValue.GetElementValue Document: XmlDocument XPathQuery: $'''/feedback/record/auth_results/spf/result''' TextValue=> spf_result
Variables.CreateNewDatatable InputTable: { ^['Org Name', 'E-Mail', 'Report ID', 'Domain', 'Source IP', 'Count', 'Disposition', 'Dkim', 'SPF', 'From', 'SPF Domain', 'Result'], [org_name, email, report_id, domain, source_ip, count, disposition, dkim, spf, header_from, spf_domain, spf_result] } DataTable=> DataTable
File.WriteToCSVFile.WriteCSV VariableToWrite: DataTable CSVFile: $'''FILEPATH:\\IT\\DMARC\\Master.csv''' CsvFileEncoding: File.CSVEncoding.SystemDefault IncludeColumnNames: True IfFileExists: File.IfFileExists.Append ColumnsSeparator: File.CSVColumnsSeparator.SystemDefault

1 ACCEPTED SOLUTION

Accepted Solutions
aamato
Regular Visitor

I was able to resolve this. I did not know there were things such as loop actions, so I put a loop action in after the Folder.GetFiles item then pushed everything else within the loop.

View solution in original post

2 REPLIES 2
aamato
Regular Visitor

I was able to resolve this. I did not know there were things such as loop actions, so I put a loop action in after the Folder.GetFiles item then pushed everything else within the loop.

Hi @aamato 

Glad to know you got it resolved.

I have curated an entire list of actions available in Power Automate Desktop V2.26.

https://cheatography.com/vjr/cheat-sheets/power-automate-desktop-actions/

As a newbie this would assist in finding out any actions during development.

 

These 9 official modules will help to get you know a lot of things.

Scroll down to the section where it says "Items in this collection"

https://learn.microsoft.com/en-us/certifications/exams/pl-500

 

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,219)