
Announcements
I am trying to create audit logs for my workflows and I am using 'Write Text to File' action as I wish to create audits on the basis of the day the workflow is executed. Here's an image for reference:
But after the flow has been run, I try to access my audit files in Excel, but I keep encountering this issue - wherein the data I wish to append - comes in different rows. Like here:
I want the ERROR and the error message with line number to be appended to 4th row, instead of the 5th. Is there a possible solution for this issue? Should I use Write to Excel action instead? Or will I have to scrap the entire thing and start over?
If you want to read those logs via Excel, you should use a different action to write it, such as Launch Excel + Write to Excel worksheet + Close Excel for Excel files, or Write to CSV file to write to a CSV file.
Write text to file is used for plain text files and it won't give you proper formatting for opening the file via Excel. You should simply read these files via a text editor, such as Notepad, Notepad++ or VSCode.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.