Save email attachments to OneDrive with Power Automate
Manually saving each email's attachments to OneDrive is slow, and it is easy to forget an important file. With Power Automate you can build an automated flow that saves those attachments into a OneDrive folder on its own whenever a new email arrives, without writing a single line of code. This step-by-step guide shows how to save email attachments to OneDrive reliably, so you never have to drag files by hand again.
Prerequisites
- A Microsoft 365 account with Outlook and access to Power Automate.
- Access to OneDrive (personal or OneDrive for Business).
- Permission to create cloud flows in your environment.
Step 1: Create an automated cloud flow
Go to the Power Automate portal at make.powerautomate.com and sign in with your Microsoft 365 account. In the left-hand menu, choose Create and then Automated cloud flow, which is a flow triggered by an event. Give the flow a clear name, such as "Save attachments to OneDrive", so you can find it later. In the trigger search box, type email and select When a new email arrives (V3) from the Office 365 Outlook connector. Confirm with Create to open the flow editor.
Step 2: Configure the trigger to include attachments
The trigger decides when the flow starts. Keep the Inbox folder selected and open the advanced options under Show advanced options. Two settings matter here: set Include Attachments to Yes, so the flow receives the file contents, and set Only with Attachments to Yes, so it runs only when the email actually carries attachments. This second option avoids unnecessary runs and keeps the run history clean.
Step 3: Save each attachment to OneDrive with "Create file"
Click New step, search for the OneDrive for Business connector and choose the Create file action. Fill in the three essential fields: in Folder Path set the destination folder, for example /Email attachments; in File Name select the dynamic content Attachments Name; and in File Content choose Attachments Content. Because an email can have several attachments, using these fields makes Power Automate wrap the action in an Apply to each loop automatically, repeating the save for every file. You do not need to configure anything else inside that loop.
Step 4: Give each file a unique name
If two attachments share the same name, the second one can overwrite the first in OneDrive. To prevent losses, add the date and time to the file name. In the File Name field, place an expression with the current moment first, followed by the dynamic content Attachments Name. The expression is this:
formatDateTime(utcNow(), 'yyyy-MM-dd_HH-mm-ss')
The final name looks something like 2026-07-06_09-15-30_invoice.pdf. The utcNow() function returns the current date and time, and formatDateTime formats it in a readable, sortable way, which also helps keep files in chronological order.
Step 5: Save only certain file types (optional)
Often you only care about PDFs or spreadsheets. To filter, add a Condition action inside the Apply to each, before Create file. On the left side choose the dynamic content Attachments Name, set the operator to contains, and on the right side type .pdf. Then drag the Create file action into the If yes branch. This way, only PDF files are saved and the rest are ignored.
Check the result
Save the flow with Save and click Test, choosing the Manually option. Send yourself an email with an attachment and wait a few seconds. Open the /Email attachments folder in OneDrive and confirm the file is there, already with the date in its name. In the flow's run history, each successful run is marked in green; if an error appears, click the run to see exactly which step failed and fix the configuration.
Conclusion
In just a few minutes you built a flow that automatically saves email attachments to OneDrive, cutting manual work and reducing the risk of losing documents. From here you can grow the automation: filter by sender, split attachments into folders by subject, or notify a team in Teams when a new file arrives. What is the next repetitive task in your day you would like to let Power Automate handle for you?