How to Save Outlook Email Attachments to SharePoint with Power Automate

C
Collab365 TeamAuthorPublished Mar 30, 2026
9,530

At a Glance

Target Audience
Power Automate makers and Microsoft 365 administrators
Problem Solved
Reliably saving incoming Outlook attachments to SharePoint without manual downloads or duplicate overwrites.
Use Case
Route invoice, contract or case attachments into a controlled SharePoint library and keep enough email context for audit.

Downloading an attachment from Outlook and uploading it to SharePoint is not a filing system. It is a person acting as a connector.

If the destination and rules are predictable, Power Automate can remove those clicks.

The basic pattern: trigger on a new email, filter it before the flow runs, create or choose the SharePoint destination, then save the message, its attachments or both.

Last reviewed: 6 August 2026.

Before you build the flow

Decide what the business record actually is:

  • The attachment only.
  • The email only.
  • The email and every attachment.
  • The email plus selected non-inline attachments.
  • A SharePoint item containing extracted values, with the original message retained separately.

Saving everything “just in case” creates duplicates and makes retention harder. Saving only attachments can discard approvals, instructions and context contained in the message.

Also decide who owns the flow, how failures will be noticed and what should happen when a file with the same name already exists.

The four-step flow

Overview of an email-attachment flow
Overview of an email-attachment flow

Step 1: Trigger on the right emails

Create an Automated cloud flow in Power Automate and choose Office 365 Outlook — When a new email arrives (V3).

Create an automated cloud flow
Create an automated cloud flow

Choose the folder to monitor, then add the narrowest useful trigger filters:

  • From for a known sender.
  • Subject Filter for a stable reference or keyword.
  • Has Attachment when the process only handles attachments.
  • To or CC when an address distinguishes the process.

Microsoft recommends filtering in the trigger rather than letting every message start a run and rejecting it later. See Trigger a cloud flow based on email properties.

Configure the new-email trigger
Configure the new-email trigger

For a small flow, set Include Attachments to Yes so the attachment content is available to later actions.

For a busy mailbox, use Include Attachments = No and add Get Attachment (V2) inside the attachment loop. Microsoft warns that downloading all attachments in the trigger can time out when many messages arrive together. The Office 365 Outlook connector documentation lists that limitation and the recommended workaround.

If the source is a shared mailbox, use When a new email arrives in a shared mailbox (V2) instead. The version number is not a typo. Then follow our shared-mailbox Power Automate guide so later actions keep the correct mailbox context.

Step 2: Choose a safe naming scheme

Do not use the subject alone as the file name. Two messages can have the same subject, and subjects can contain characters that SharePoint will not accept in a file name.

A safer pattern combines a received timestamp with a unique value, for example:

20260806-143522-7f3b...-invoice.pdf

In Power Automate, you can build the timestamp from the email’s received time and use guid() when you need guaranteed uniqueness.

If humans need readable names, retain the original attachment name after the unique prefix. If a downstream system needs a stable business identifier, use the invoice, case or project ID instead of inventing one from the subject.

Initialise a file-name variable
Initialise a file-name variable

You do not need a new folder for every email. Create per-message folders only when the email and several attachments must remain together. Otherwise, a document library with useful columns is usually easier to search and govern than thousands of tiny folders.

Initialise a folder-name variable
Initialise a folder-name variable

Step 3: Create the SharePoint destination and optionally save the email

Use SharePoint — Create new folder only if your design genuinely requires a folder per message.

Create a SharePoint folder
Create a SharePoint folder

To preserve the complete message, add Office 365 Outlook — Export email (V2) and pass it the message ID from the trigger. Microsoft documents that this action exports the message in EML format.

Export the email
Export the email

Then add SharePoint — Create file:

  • Site Address: the target SharePoint site.
  • Folder Path: the library or folder chosen for the process.
  • File Name: your safe name ending in .eml.
  • File Content: the output of Export email (V2).

Create the email file in SharePoint
Create the email file in SharePoint

For a shared mailbox, also populate Original Mailbox Address on the export action. Otherwise the connector can fall back to the mailbox belonging to the connection owner.

Step 4: Save the attachments

Loop through the trigger’s attachments and add SharePoint — Create file inside the loop.

Check whether the email has attachments
Check whether the email has attachments

Map:

  • File Name to the attachment name, preferably with your unique prefix.
  • File Content to the attachment content from the trigger or Get Attachment (V2).

Create an attachment file
Create an attachment file

When you select attachment dynamic content, Power Automate normally adds an Apply to each loop automatically.

Apply the file action to each attachment
Apply the file action to each attachment

Inline logos and email-signature images can appear as attachments. If your process does not need them, add a condition that excludes items marked as inline. Test this with real messages from your organisation because signatures and security products alter messages in different ways.

Files saved in SharePoint
Files saved in SharePoint

Add metadata after the file is created

Saving a file is only half the job if colleagues must find it later.

After Create file, use Update file properties to populate columns such as:

  • Sender.
  • Received date.
  • Original subject.
  • Mailbox.
  • Client, case or project ID.
  • Processing status.
  • A unique source-message reference.

Only map values you genuinely have. If a human must decide the correct matter or project, a background flow may be the wrong filing experience. That is one of the points where a specialist Outlook add-in can add value. See our comparison of native Microsoft 365 and specialist email-filing tools.

Failure modes worth designing for

The trigger runs twice

Microsoft Defender for Office 365 Safe Attachments with Dynamic Delivery can cause the email trigger to run once before attachment analysis and again afterwards. Microsoft recommends checking that the attachments array contains items before processing it.

Use a durable source identifier or another duplicate check before creating files. A successful run is not proof that the same message has not already been processed.

Some messages are missed during a burst

Microsoft states that mail triggers can rarely miss messages when many arrive at the same time. If every message is a regulated or financially important record, a simple event trigger may not be a sufficient control by itself. Add reconciliation or use a design that periodically checks for unprocessed messages.

The connector times out while downloading attachments

Change Include Attachments to No, then fetch each attachment with Get Attachment (V2). Keep the initial trigger narrow.

An attached email is missing

The Outlook connector distinguishes file attachments from item attachments. Microsoft documents that attached messages and calendar items are not fully supported in trigger responses; EML, MSG and ICS files may need to be placed in a ZIP file or retrieved through another approach.

The flow overwrites or duplicates files

Use an explicit naming and conflict policy. Decide whether the correct behaviour is to reject, version, rename or update an existing item. Do not let the default behaviour make that business decision for you.

Test before switching it on

Send at least these messages through the flow:

  1. No attachment.
  2. One ordinary PDF.
  3. Three attachments with the same email.
  4. An inline signature image.
  5. Two attachments with the same name on different messages.
  6. Two messages with the same subject.
  7. A digitally signed or encrypted message used by your organisation.
  8. A message larger than your normal case.
  9. A message sent during a short burst.
  10. A message after the destination folder has been renamed or removed.

Check the run history, the SharePoint files, the metadata and the notification path for failures.

Keep the flow supportable

Record the owner, connection account, source mailbox, destination, filters, duplicate rule and failure alert beside the flow. A useful automation should not become an archaeological dig when its original maker leaves.

Microsoft’s Office 365 Outlook connector reference is the best place to check current limits. It is more reliable than copying an expression from an undated forum answer.

For practical Power Automate patterns and current Microsoft changes, explore the Power Automate Builders Space with a 7-day trial.