While working on a Power Automate, I needed to save email attachments directly to a SharePoint document library. The team wanted a simple way to keep all important files from emails in one place without manually downloading and uploading them.
Handling multiple emails daily made this process time-consuming, so I used Power Automate to automate it. This way, all attachments were automatically saved to the correct folder, saving time and effort.
In this tutorial, I will show you how to save email attachments to a SharePoint document library using Power Automate. Whether you want to save all attachments, organize them based on the sender or subject, or filter specific file types like PDFs.
Save Email Attachments to SharePoint using Power Automate
Suppose your HR team receives job applications via email with resumes attached as PDF files in your organization. They want to automatically save these resume attachments to a SharePoint document library named Job Applications for better organization and accessibility.

Now follow the below steps:
1. Create an automated cloud flow with a trigger When a new email arrives (V3), action and provide the below parameters:
- Folder: Click on the File icon and choose the inbox option.
- Include Attachments: Select the yes option from the drop-down.

2. Add Apply to each action, then select an output from the previous steps box inside. Provide attachments from dynamic content for when a new email arrives.

3. Inside the Apply to each action, add a Get Attachment (V2) from the outlook connector and provide the below parameters:
- Message Id: Provide Message Id from dynamic content When a new email arrives.
- Attachment Id: Provide Attachment Id from dynamic content When a new email arrives.

4. Then, Inside the Apply to each loop, add a Create file action and provide the below parameters:
- Site Adress: Select the site address from the drop-down list.
- Folder Path: Select the folder path from the file icon.
- File Name: Provide the Attachment file name from the dynamic content.
- File Content: Provide the content bytes from dynamic content.

Now save the flow and run the flow manually. Then save an email test user to this account when you create flow.
As you can see, I received an email with an attachment from a test user.

After the flow runs successfully, check whether the SharePoint document library to the file is present.

Save Email Attachments to SharePoint Based on the Sender in Power Automate
Suppose the finance team regularly receives invoices from multiple vendors via email. To make essay their document management, they want to save these invoices to a SharePoint document library named Vendor Invoices.
The attachments should be saved in subfolders based on the sender’s email address (If invoices are from [email protected], go to the Vendor1 folder; invoices from [email protected] go to the Vendor2 folder).

In this example, I will tell if the email came from User2. It will be stored in the User2 folder.
To do this, follow the below steps:
1. Create an automated cloud flow with the trigger. When a new email arrives (V3), action and provide the below parameters:
- Include Attachments: Select the yes option from the drop-down.

2. Then add a condition action that checks whether the email came from User2.
@{triggerOutputs()?['body/from']} is equal to [email protected]
3. Then, in the true section, add the Get Attachment action and provide the Message Id and Attachment Id.
It will automatically add a For each loop.

4. Then, Inside the For each loop, add a Create file action and provide the below parameters:
- Site Adress: Select the site address from the drop-down list.
- Folder Path: Select the folder path by clicking the file icon.
- File Name: Provide the Attachment file name from the dynamic content.
- File Content: Provide the content bytes from dynamic content.

Now save the flow and run it. When you receive an email for User 2, it will be stored in the User 2 folder.

You can use the switch condition if multiple users are interested in condition action.
Save Email Attachments to SharePoint Based on Subject Filter Contains the Value in Power Automate
In the above example, we see a specific user. Now, I will show you how to save email attachments to SharePoint based on the subject filter containing the value in Power Automate.
Now follow the below steps:
1. Create an Automated Cloud Flow using the Outlook connector’s ‘When a new email arrives (V3)‘ trigger. Then Provide below parameters:
- Include Attachments: Select the yes option from the drop-down.

2. Then expand the Advanced parameters, select Subject Filter inside the box, and put your filter value.
In my case, I want to save the attachment in sharepoint when the subject contains a particular keyword, such as Invoice.

3. Then add a Get Attachment action and provide the Message Id and Attachment Id from When a new email arrives (V3).
It will automatically add a For each loop.

4. Inside the For each loop, add a Create file action and provide the below parameters:
- Site Adress: Select the site address from the drop-down list.
- Folder Path: Select the folder path by clicking the file icon.
- File Name: Provide the Attachment file name from the dynamic content.
- File Content: Provide the content bytes from dynamic content.

Save the flow and run it. When you receive an email, the flow will check if the subject contains the word ‘Invoice‘ and store the attachment in the SharePoint document library.

Save Only PDF Attachments in SharePoint Document Library using Power Automate
Imagine you’re working in the HR department of a company and frequently receive emails containing various file attachments (PDFs, images, Word documents, etc.). These attachments often include employee documents such as resumes, certificates, or signed agreements.
However, you only need the PDF files from these emails to be stored in a SharePoint document library called Employee Records for easy access and organization.

To do this, follow the below steps:
1. Use the “When a new email arrives (V3)” trigger to monitor a specific folder in your Outlook inbox. Then Provide below parameters:
- Include Attachments: Select the yes option from the drop-down.
- Folder: Select the Inbox from the drop-down.

2. Then add a Get Attachment action and provide the Message Id and Attachment Id from When a new email arrives (V3).
It will automatically add a For each loop.

3. Then add a Condition action and provide the below condition:
Name ends with .pdf
4. Add the Create file action to upload the PDF to your SharePoint document library (Employee Records) in the Ture section.
- Site Adress: Select the site address from the drop-down list.
- Library Name: Employee Records
- File Name: Attachment Name
- File Content: Attachment Content

Save the flow and Send a sample email with multiple attachments (PDF and non-PDF) to verify that only PDF files are saved in the document library.
I received an email with three attachments (JohnDoe_Resume.pdf, JohnDoe_ProfilePicture.jpg, Signed_Agreement.pdf).

The flow will ignore JohnDoe_ProfilePicture.jpg and only upload JohnDoe_Resume.pdf and Signed_Agreement.pdf to the Employee Records library.

This way, you can save only specific types of attachments, like PDFs, in the SharePoint document library.
Conclusion
This tutorial covered how to save email attachments to a SharePoint document library using Power Automate. We explored scenarios such as saving all attachments, saving attachments based on the sender, filtering attachments by subject, and saving only specific types of attachments like PDFs. These automated workflows make managing email attachments easier, save time, and ensure better organization in your SharePoint libraries.
You may also like:
- Add Attachments to SharePoint List Items using Power Automate
- Convert a String to a Decimal Number in Power Automate
- Send an Email With Attachment From SharePoint List using Power Automate
- Save SharePoint List Attachments to a SharePoint Library Using Power Automate
- Save Office 365 Email Attachments to OneDrive for business using Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.
I’m not sure where you found the condition called, Condition SharePoint File Not Created action. I don’t see that as part of the condition list.
I cannot wrap my head around this particular flow. Why does it need IsFromFilterApplied condition? Cannot I just specify from e-mail address in trigger if I want this flow to save attachments from mails from particular person? What’s the difference?