Back in early 2020 we released the ‘Convert Excel‘ action for Power Automate, which provides the capability to convert spreadsheet file formats to another format. For example, XLS to XLSX, CSV to PDF, CSV to XLSX, etc. The following post provides some basic examples: Convert Excel and CSV Files in Power Automate. Over the past few months, we’ve received several support tickets and multiple queries on the Power Automate forums asking how CSV files and CSV data can be converted into a Microsoft Excel (XLSX) file, and in this post, we’re going to cover both scenarios.
It is very important to distinguish whether you are working with a file or just data, as Power Automate handles these differently. Power Automate exchanges files as ‘File Content’ properties which contain a binary file encoded in base64 format, thus sending a CSV file would look similar to Flow Configuration:
The Input data sent to the Encodian action:
Compare this with CSV Data:
The Input data sent to the Encodian action:
Now, typically, you do not need to worry about whether you’re passing plain text data or a base64 encoded file, as Power Automate contains automated data formatting capabilities which dynamically send/receive data in the correct format pertaining to the data type of the sending / receiving properties, however upon occasion it may be beneficial to forcefully apply the data type by converting plain text data to a base64 encoded file to avoid data processing issues.
Building upon the previous example, I’ll update the flow so that the ‘CSV Data‘ string variable is forcefully converted to a base64 encoded file and add Microsoft Excel (XLSX file) created by the ‘Convert Excel‘ action to OneDrive. 1. Update the ‘Convert Excel‘ action 1.a. File Content: Remove the existing ‘CSV Data‘ string variable before re-adding wrapped within the base64() expression
2. Add the OneDrive ‘Create File‘ action
2.a. Folder Path: Select the location to store the file
2.b. File Name: Select the ‘Filename‘ property provided by the Encodian ‘Convert Excel‘ action
2.c. File Content: Select the ‘File Content‘ property provided by the Encodian ‘Convert Excel‘ action
The Microsoft XLSX file created from the CSV Data provided:
Building upon the previous example, I’ll update the flow so that the Microsoft Excel (XLSX file) created by the ‘Convert Excel‘ action is added to OneDrive. The initial flow is configured as follows: a ‘File Content‘ property representing the CSV file is selected when the flow is triggered. Noting the file could come from any source (OneDrive, HTTP, SharePoint, Teams, Box, Azure Storage, etc), you just need to pass the ‘File Content’ property to the Encodian ‘Convert Excel‘ action.
2. Add the OneDrive ‘Create File‘ action
2.a. Folder Path: Select the location to store the file
2.b. File Name: Select the ‘Filename‘ property provided by the Encodian ‘Convert Excel‘ action
2.c. File Content: Select the ‘File Content‘ property provided by the Encodian ‘Convert Excel‘ action
The Microsoft XLSX file was created from the CSV file provided:
Hopefully, this post will help you to build solutions converting CSV files and data using our ‘Convert Excel‘ action. If you have any technical queries, please visit our customer support portal.
We hope you’ve found this helpful guide. As ever, please share any feedback or comments. All are welcome!
UPDATE: We’re excited to announce some significant updates to Flowr for Power Automate! As of October 2024, we’ve improved by updating action names and splitting Flowr’s central Power Automate connector into nine specialized connectors. These changes will make your workflow faster, smoother, and more efficient. The new action names are more precise and intuitive, saving you time, while the focused connectors enhance performance and flexibility. This update also helps future-proof the platform for even more powerful features. Check out our updated action names blog.
Managing Director