• Ajith Madathil

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’.



713 views0 comments

Recent Posts

See All

The Compose action

Microsoft Power Automate (aka Microsoft Flow) provides lots of action steps out of the box. My favourite one is Compose. What does it do? What is the Compose action? The Compose action is like a stati

How to call an API using the Power Automate HTTP action

In this blog post I will access NASA's Astronomy Picture of the Day (APOD) API using Power Automate. The plan is to retrieve the picture of the day using the API and store it in a SharePoint document

Blog Categories
 

Beginner

Intermediate

 

Advanced

Power Automate Essentials

How can I help you?

I am happy to help at any time.  You can contact me via the official PowerAutomate community forum.  Tag me (@abm) on any post you make there if you would like to me take a look at it.

I am always available for both corporate training or 1-2-1 training for individuals.