Microsoft flow examples: Save Office 365 email attachments to OneDrive for Business

Are you looking out for some Microsoft flow examples? Let us check out one here. How to save Office 365 email attachments to OneDrive for Business in Microsoft Flow or Power Automate.

Here we will how to use the Microsoft flow template “Save Office 365 email attachments to OneDrive for Business”.

Also, We will discuss the “Flow for attaching multiple OneDrive for Business files to an email”.

Microsoft flow examples

In this Microsoft flow example, we will see how to create a flow that will trigger when you receive an email with attachments in Office 365 outlook. And the flow will save the email attachments to OneDrive for Business.

Here, we will use a flow template “Save Office 365 email attachments to OneDrive for Business” to create the flow.

  • To create a Microsoft Flow, First of all, Sign in to your Microsoft Office 365 account, then go to “App launcher” and then click on “Power Automate“.
  • Go to the Templates option in the left navigation and search for “Save Office 365 email attachments to OneDrive for Business“.

Click on the Save Office 365 email attachments to OneDrive for Business template.

Save Office 365 email attachments to OneDrive for Business
Microsoft flow examples

Now, sign in to Office 365 Outlook and OneDrive and give permission to access your account. Basically, you need to configure.

Click on Create Flow.

Save Office 365 email attachments to OneDrive for Business flow
Microsoft flow examples

Once you click on Create Flow, it will create a flow then click on Edit to edit the flow.

Save Office 365 email attachments to OneDrive for Business Ms flow
Power Automate or Microsoft flow examples

Once the Flow will open, then in the “On new email” trigger, click on the folder icon to select the folder where you want to receive an email.

Click on Show advanced options to expand the trigger.

Save Office 365 email attachments to OneDrive for Business Microsoft flow
Save Office 365 email attachments to OneDrive for Business

Here, you can set up the filter on the fields of the “On new email” trigger, which are as follows:

  • Folder: Select the mail folder where you want to check the new mail.
  • To: Provide the recipient email addresses.
  • From: Add an email address for a specific email you want to save the attachments.
  • Include Attachments: Select Yes/No or custom value.
  • Subject Filter: Give the string to look in the subject line.
  • Importance: Select the priority of the mail from the drop-down arrow.
  • Only with Attachments: If set to Yes, only emails with an attachment will be retrieved. Emails without an attachment will be skipped. If set to No, all emails will be retrieved.
    • Custom Value: In custom value, you can enter only a Boolean value(True/False).

Note: I prefer not using the filters in this section of the workflow. Follow the blog for detail.

Example of Microsoft flow
Save Office 365 email attachments to OneDrive for Business

In the “Apply to each Attachment on the email” action, Insert “Select an output from previous steps” from Add dynamic content >> Dynamic content >> Select Attachments.

Then, click on Create file action to expand it.

Example of MS flow
Microsoft flow examples

Read Power Automate Filter Array

In Create file action, having below fields as:

  • Folder Path: You can select the folder path where you want to send the attachments in OneDrive. Click on Show picker icon >> Select Root >>Click on the next arrow icon (>)>> Select the Email attachments from Flow.
  • File Name: Click on the field >> Go to Dynamic content >> Search Attachments Name.
  • File Content: Click on the field >> Go to Dynamic content >> Search Attachments Content.
save email attachment in OneDrive
flow example

After Create file action, In the Condition action, this condition is added by default like the below screenshot.

save email attachments in OneDrive
flow examples

Then click on Save >> Test.

automated flow example
Power automate examples

Once you click on Test, it will open the Test Flow window. Select I’ll perform the trigger action >> Test.

Once the Flow ran successfully, you can see the status now becomes as “Your flow ran successfully” like below. All the steps completed successfully will be notified in green tick mark like below:

Automated flow template example
Power automate examples

Now, go to “My Flows”. Click on My Flows and you can see the flow created like below:

microsoft flow templates
Microsoft flow templates

In My Flows, click on Save Office 365 email attachments to OneDrive for Business to see the details of flow, and in detail, you can see Status is Succeeded.

How to create a flow using template
run Microsoft flow

Now, go to Outlook, here I received an email from another user with an attachment. Now, go to Onedrive and check the attachment is saved or not.

Automated ms flow examples
run Microsoft flow

Open Office 365 OneDrive and here you can see the attachment of an email is saved in My Files.

Save Office 365 email attachments to OneDrive for Business
Save Office 365 email attachments to OneDrive for Business

Read Power Automate Parse Email Body

Flow for attaching multiple OneDrive for Business files to an email

If you want to save multiple attachments in OneDrive of an email follow the below steps:

In Create file action, having below fields as:

  • Folder Path: You can select the folder path where you want to send the attachments in OneDrive. Click on Show picker icon >> Select Root >> Click on the next arrow icon (>)>> Select the Email attachments from Flow.
  • File Name: Click on the field >> Go to Dynamic content >> Search Attachments Name.
  • File Content: Click on the field >> Go to Dynamic content >> Search Attachments Content.
Flow for attaching multiple OneDrive for Business files to an email
Flow for attaching multiple OneDrive for Business files to an email

Insert the Condition action, select Is folder from the Dynamic content.

Condition: Is folder? is equal to fx true.

save multiple attachment to OneDrive
Flow for attaching multiple OneDrive for Business files to an email

If the condition satisfies, then the flow will come to If yes condition and create a folder in OneDrive, to save the email attachments.

Now, In Delay action, having the below fields details:

  • Count: Give the delay time.
  • Unit: Select the unit from the drop-down list.
multiple attachment to OneDrive
Microsoft flow examples

In Create file retry action, having below fields as:

  • Folder Path: You can select the folder path where you want to send the attachments in OneDrive. Click on Show picker icon >> Select Root >>Click on the next arrow icon (>)>> Select the Email attachments from Flow.
  • File Name: Click on the field >> Go to Dynamic content >> Search Attachments Name.
  • File Content: Click on the field >> Go to Dynamic content >> Search Attachments Content.
save emails attachment to OneDrive
Microsoft flow examples

Here, you can see the full structure of the Microsoft flow template (Save Office 365 email attachments to OneDrive for Business).

Once all things will over, Click on “Save“. Now click on “Flow Checker” whether there is an error or not and if not, then “Test” the flow.

Save Office 365 email multiple attachments to OneDrive for Business
Power automate examples

Once the Flow ran successfully, you can see the status now becomes “Your flow ran successfully” like below. All the steps completed successfully will be notified in green tick mark like below:

Automated flow template example
Power automate examples

Here, you can see that I have received an email with multiple attachments in Outlook Office 365. Now I have to check the attachments are saved in OneDrive or not.

save multiple attachment in OneDrive
microsoft flow examples

Open OneDrive, then go to My files. Here, you can see a folder created with the folder name Email attachments from Flow.

In Email attachments from Flow folder, you can see all the multiple attachments of an email.

save multiple attachments in OneDrive
Power Automate or microsoft flow examples

You may like the following Microsoft flow tutorials:

In this Microsoft flow example, we discuss how to save Office 365 email attachments to OneDrive for Business using Microsoft flow or Power Automate. Also, we checked Flow for attaching multiple OneDrive for Business files to an email.

  • >