Save Office 365 Email Attachments to OneDrive for business using Power Automate

Do you want to save Office 365 email attachments to a specified OneDrive folder using Power Automate? Then this Power Automate tutorial is for you. Here I will show how to save email attachments to OneDrive using Power Automate.

Scenario:

Recently, I was required to save email attachments to a OneDrive folder using Power Automate flow. Whenever employees send their documents through email, the attached documents will automatically be saved to the specific folder in OneDrive.

Now we will see how we can achieve it. Also, the flow that we are going to create now supports saving a single attachment and multiple attachments to the OneDrive folder.

Save Office 365 Email Attachments to OneDrive for business using Power Automate

Let us see how to save email attachments to OneDrive using Power Automate.

Step-1:

Create an automated cloud flow and select the trigger when a new email arrives (V3) from the trigger actions. Expand the trigger action and choose the parameters as highlighted below:

  • Folder: Select the Folder; here, I have selected my Inbox folder presented in Outlook. Then Click Show Advanced options, and choose the below parameters
  • Include Attachments: select the yes option.
save email attachment to onedrive power automate

Step-2:

  • Add a compose data operation and pass the attachment content from dynamic content to get the attachment content presented in the attachment.
  • It will automatically add the apply to each control loop. If the email contains multiple attachments, it will get all the attachments.
save office 365 email attachments to specified onedrive for business folder

Add a new step, choose the Create file (for OneDrive)action, and provide the required parameter:

  • Folder Path: From the show picker select the folder path where you want to save the attachments (I have selected the EmployeeDocuments folder)
  • File Name: from the dynamic content value, select the attachment file name.
  • File Content: pass the below expression under the expression tab of the compose data operation from dynamic content to read the attachment content.
base64ToBinary(outputs('Compose'))
save office 365 email attachments to onedrive for business

Our complete flow looks like the below:

power automate email attachment to onedrive

Step-3:

See also  SharePoint column formatting examples

Test case-1: (Single Attachment)

Save and test the flow. I have sent an email with an attachment from the test user ID.

power automate save attachment to onedrive

Once the flow runs successfully like the below:

save attachment to onedrive in power automate

We can see that it saves the attachment to the specific OneDrive folder.

save attachment to onedrive in power automate flow

Test case-2: (Multiple Attachments)

I have sent an email with multiple attachments from the different test user ID.

save office 365 email attachments to specified onedrive for business folder using flow

Once the flow runs successfully like the below:

save office 365 email attachments to onedrive for business using flow

We can see that it reads all the attachments and saves the attachment to the specific OneDrive folder.

save office 365 email attachments to onedrive folder using flow

This is how to save an attachment to OneDrive using Power Automate.

Conclusion

So I hope you get an idea to save Office 365 email attachments to OneDrive for business specific folders in Power Automate.

Here I have shown you two different test cases (single attachment and multiple attachments) to save email attachments to OneDrive specified folder using Power Automate flow.

You may like the following tutorials:

  • >