Power Automate and SharePoint
This set of quick tips aims to explain some issues and how to resolve them for common use cases when working with SharePoint files in Power Automate.
These tasks may seem to be easy to implement using the existing actions under the SharePoint category in Power Automate but as soon as we start using them, we face some annoying errors.
One the common tasks when connecting to SharePoint from a flow is to create a blank excel file and then populating that file with some data from the flow. For example, in a scenario that we want to export some data from a Dataverse table into a excel file, a blank excel file needs to be created first and then the file can be populated with the data using some other actions such as “Create Table” or “Add row into a table”. Unfortunately, there is no action to create a blank excel file in Power Automate, so we need to create a blank excel file in a SharePoint library manually and then copy that file each time a new file is needed. However, there is simple way to create a blank excel file directly from the flow without any dependency to an external file in SharePoint.
1. Firstly, we need to create a blank excel file in SharePoint manually and then read that file in a temporary power automate flow as shown in the following screenshot:
The “Get file content using path” action can be used to read the content of the blank excel file from the SharePoint. Then, after running the flow the content of the file is available in the output of the flow action as shown in the following screenshot:
2. Now we need to copy the content value from the output and store it in a compose action as shown in the following screenshot:
3. The blank excel file in the SharePoint and the actions that we used to read the content of the file are no longer needed because we can use the compose action to create a new file directly from the flow as shown in the following screenshot:
As can be seen in the above screenshot, the output of the compose action contains the file content that we need to create a new file so we can copy that compose action in any flow that we need to create a new excel file and easily create a new blank file without the need of a file in SharePoint.