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
Solved! Go to Solution.
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.
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
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
20 | |
17 | |
17 | |
12 | |
11 |