Email OneDrive files using Power Automate
Updated: Apr 1, 2020
First step is the trigger. Here I am using a manual trigger.
The next step is to declare an array variable called FileContents. This is used for storing the filename and file content.
Next, we need to read the list of files in a folder from OneDrive. The Power Automate List files in folder step will give you the metadata of files.
Next we build a loop for reading each file from OneDrive. We store the filename and content bytes under the array variable.
Once the loop is executed successfully, we have all the files and their byte contents in the FileContents array.
Finally, we can use the action Send an email for sending the files.
Once the Send an email action is added you can see the below properties as default.
By default, you can attach one filename and content. By clicking Add new item will allow more files to be attached at one time.
Click the above highlighted icon to switch to input entire array so that we can set the FileContent array variable here.
This way we can set all the files and contents under a single property called ‘Attachments’.