In this guide, we will create our first flow using a Power Automate template. After setting up the flow, we will run it and review the results.
In our daily work, we receive numerous emails, many of which include attachments. As the volume of emails increases over time, retrieving attachments from older emails becomes increasingly inconvenient. Additionally, storing attachments across various emails makes it challenging to manage and use them consistently. To address these issues, we will create a flow that automatically saves attachments from received emails to a specific folder in OneDrive for Business. The flow will also rename the attachments by adding the email’s date stamp for easier future retrieval.
Steps to create the flow
- On the Power Automate homepage, click “Templates” in the navigation bar to access the template selection interface.
- In the “Search templates” box, enter “OneDrive for Business” and select the template “Save Office 365 email attachments to specific OneDrive for Business folder“.

- Power Automate will check the login permissions for the connectors used in this template. This flow uses two connectors: Office 365 Outlook and OneDrive for Business, both of which require login. If the login is not successful or the permissions are incorrect, a red cross will appear, and you will need to fix the connection. If everything is fine, a green checkmark will appear next to each connector, and then you can click “Continue”.

- You will then enter the flow editing interface. If the flow is compatible with the new designer, it will default to using the new designer. If you prefer the traditional designer, you can disable the “New designer” option in the top right corner to switch back.

- Trigger (On new email): the flow is triggered when a new email arrives. You can configure the parameters and settings for triggering the flow, such as specifying the email folder, setting conditions for To (recipient), CC (carbon copy), From (sender), Importance, Attachment, and Subject. For example, the subject contains “Change Notice Weekly Reports”.

- Action (Condition): Condition is one of the actions. It determines the following actions based on criteria related to the sender, recipient, subject, and body of the email. If the received email meets the specified conditions, the actions on the left are executed; otherwise, the actions on the right are executed. Here, we set the condition to check if the body contains “Change Notice”.

- If the condition is met, the following actions are performed for each attachment in the email:
- Folder Path: Save the attachments to a specific folder in OneDrive for Business. The folder must be created in OneDrive for Business beforehand. Click the folder icon and select the corresponding folder.
- File Name: By default, Power Automate uses the original attachment name, which may lead to duplicate names. We modify this by adding the email received time to make the attachments easier to find and identify, avoiding duplicate names. Click the “File Name” field, and a dynamic content editor will appear on the right, showing dynamic content available for this action, mainly outputs from previous actions. Before the original “Attachments Name,” select “Received Time” from the “On new email” trigger in the dynamic content editor, then add a “-” to separate the time and the name.
- File Content: The template has already selected “Attachments Content” from the dynamic content editor.

- If the condition is not met, no action is required. Delete the actions in the right branch.
- After setting up the actions, click the “Save” button in the top right corner of the editing interface to save the flow.

- Finally, test the flow. Send an email with the subject “Change Notice Weekly Reports” and body containing “Change Notices” along with attachments to your own email. Then, log in to OneDrive for Business to see that the attachments have been correctly saved.
- Return to the flow management interface to view the flow’s run history.
