I know this is an old thread but I'd like to chime in here for other lost users with an example that made quick work of this for me. It converts .xml to .csv but will also convert excel files to .csv tables.
If you would like to directly convert the file without having to iterate through all XML nodes in multiple loops, you can directly convert the file using a CMD script calling a .vbs file that does the transformation for you. It takes all but a few milliseconds to process.
What I did was
Create a blank .txt document (use notepad)
Add the following text to the text document (this is VBS scripting)
if WScript.Arguments.Count < 2 Then
WScript.Echo "Please specify the source and the destination files. Usage: EXCELtoCSV <xls/xlsx source file> <csv destination file>"
Wscript.Quit
End If
csv_format = 6
Set objFSO = CreateObject("Scripting.FileSystemObject")
src_file = objFSO.GetAbsolutePathName(Wscript.Arguments.Item(0))
dest_file = objFSO.GetAbsolutePathName(WScript.Arguments.Item(1))
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(src_file)
oBook.SaveAs dest_file, csv_format
oBook.Close False
oExcel.Quit
Save the text document to your desktop & name it "ExceltoCSV" (I know this doesn't sound right but it works)
Change the extension of the text document from .txt to .vbs
In your Power Automate Desktop (PAD) process, add the action 'Run DOS command'
Set the properties of the DOS command as follows:
DOS command or application = EXCELtoCSV.vbs YourXMLFileName.xml YourXMLFileName.csv
(**Important here that you use only your XML file's name followed by the appropriate .csv or .xml)
Working Folder = c:\users\<Your username>\Desktop
- Run the process and get your results
Important to note that wherever you are performing the conversion (DOS working folder, you place the .xml file there for conversion. Also, you need to ensure the .VBS file you created is also located in that folder. I only used "Desktop" as an example. I usually run this in my c:\foldername
Hope this helps someone one day.