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.
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.
Once you click on Create Flow, it will create a flow then click on Edit to edit the flow.
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.
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.
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.
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.
After Create file action, In the Condition action, this condition is added by default like the below screenshot.
Then click on Save >> Test.
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:
Now, go to “My Flows”. Click on My Flows and you can see the flow created like below:
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.
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.
Open Office 365 OneDrive and here you can see the attachment of an email is saved in My Files.
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.
Insert the Condition action, select Is folder from the Dynamic content.
Condition: Is folder? is equal to fx true.
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.
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.
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.
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:
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.
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.
You may like the following Microsoft flow tutorials:
- Microsoft Flow or PowerAutomate Example: Send a customized email when a new file is added
- Microsoft Flow or PowerAutomate Example: Save my email attachments to a SharePoint document library
- Convert SharePoint document to PDF using Power Automate
- Convert SharePoint list item to PDF using Flow or Power Automate
- Convert Email to PDF using Microsoft flow or Power Automate
- Saving microphone audio recorded in PowerApps to SharePoint online
- Saving microphone audio recorded in PowerApps to SharePoint online
- Get a push notification when a new file is added to OneDrive for Business
- Save Twitter Tweets in SharePoint Online list using Microsoft Flow
- Power Automate SharePoint Get Items Filter Query
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.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Do that flow free up outlook cloud storage space or just send the attachment copy to onedrive?