Do you want to save email attachments to SharePoint using Power Automate Automate? This Power Automate tutorial will show us how to save email attachments to SharePoint in Power Automate.
Also, we will cover how to save email attachments to SharePoint with a different name using Power Automate. Finally, we will save only PDF attachments to SharePoint using Power Automate.
Power Automate save email attachment to SharePoint
Here we will see how to save email attachments to the SharePoint document library using Power Automate.
For example, we receive ‘Resume attachments’ in the company Outlook email address every day, and I want to automatically save those attachments to the Resume document library in SharePoint.

To do this in Power Automate I have followed the below steps:
1. Open Power Automate Cloud, create an Automated Cloud flow, and then select a trigger action as ‘When a new email arrives (V3)’ action. Then provide the below information:
- Folder: Select Inbox from the option
- Include Attachments: Select the Yes option
- Only with Attachments: Select the Yes option.

2. Now we will get email attachments, for this, click on the +New step -> select Get attachments(V2) action. Then provide the below information:
- Message Id: Select Message ID from dynamic content. This will automatically apply to each action.
- Attachment id: Select Attachment attachment id from dynamic content.

3. Finally, we will save email attachments in the SharePoint document library, for this click on the +New step -> select Create file action. Then provide the below information:
- Site address: Provide the SharePoint site address.
- Folder path: Select the Folder path from dynamic content.
- File name: Select the file name from dynamic content.
- File content: Select the content bytes from dynamic content.

4. Now save the flow and run the flow manually, then send an email to the Outlook inbox.

You can see the above email attachments are saved in the SharePoint document library

This is how to get attachments from email and save to the SharePoint document library using Power Automate.
Power Automate save email attachments to SharePoint with a different name
Here we will see how to save email attachments to SharePoint with a different name using Power Automate.
For example, whenever a client sends project-related documents via email, I want to automatically save these attachments to the SharePoint document library named “Project Documents” with a new name that includes the original attachment name and today’s date.

To save email attachments to SharePoint with a different name follow the below steps using Power Automate.
1. Open Power Automate Cloud, create an Automated Cloud flow and then select a trigger action as ‘When a new email arrives (V3)’ action. Then provide the below information:
- Folder: Select Inbox from the option
- Include Attachments: Select the Yes option.
- Only with Attachments: Select the Yes option.

2. Next, initialize two variables for the Attachment name and today’s date. for this click on the +New step -> select Initialize variable. Then provide the below information:
Name | Type | value |
---|---|---|
Attachment name | String | |
Todays date | String | formatDateTime(utcNow(),’yyyy-MM-dd’) |

3. To get the attachment from an email, click on the +New step -> select Get attachment(V2) action. Then provide the below information:
- Message-Id: Select Message ID from dynamic content. This will automatically apply to each action which will loop through messages.
- Attachment id: Select Attachment attachment id from dynamic content. this will add another Apply to each action that will loop through attachments.

4. To get the attachment or file name, for this, click on the +New step -> select Compose action. Provide the below information:
- Inputs: Provide the below expression:
first(split(outputs('Get_Attachment_(V2)')?['body/name'], '.'))

5. To get the attachment extension, click on the +New step -> select Compose action -> provide the below information:
- Inputs: Provide the below expression:
last(split(outputs('Get_Attachment_(V2)')?['body/name'], '.'))

6. Next, we will combine filename, today’s date, and extension to create a new file name, for this click on the +New step -> select Set variable action. Then provide the below information:
- Name: Select the Attachment name from the dropdown.
- Value: Provide the below expression:
concat(outputs('Compose'), '-', variables('Date'), '.', outputs('Compose_1'))

7. To save email attachments to SharePoint with different names, click on the +New step -> select Create file action, and then provide the below information:
- Site address: Provide the SharePoint site address
- Folder path: Provide the folder path
- File name: Select the Attachment name variable from dynamic content.
- File content: Select content bytes from dynamic content.

8. Now save the flow and run the flow manually. Then send an email to the Outlook inbox.

You can flow runs successfully and the email attachment is saved to SharePoint with a different name.

This is how to save email attachments to SharePoint with different names using Power Automate.
Power Automate saves only PDF attachments
Here we will see how to save only PDF attachments to the SharePoint document library using Power Automate.
when an employee submits an expense reimbursement document via email, requesting reimbursement, the attachments will be automatically saved in the Expense Reimbursement Document Library in SharePoint.Additionally, a condition is applied to ensure that the document is in PDF format.

To do this using Power Automate follow the below steps:
1. Open Power Automate Cloud, create an Automated Cloud flow, and then select a trigger action as ‘When a new email arrives (V3)’ action. Then provide the below information:
- Folder: Select Inbox from the option
- Include Attachments: Select the Yes option.
- Only with Attachments: Select the Yes option.

2. Next, we will check the attachment type, for this click on the +New step -> select Condition action. Provide the below information:
- Choose a value: Select the Attachment name from dynamic content. This will Apply to each action to the flow.
- Operator: Select the operator as ‘contains’ from the option
- Choose a value: Write the value as .pdf

3. If the condition is true, then we will get an attachment from the email, for this, click on the +New step -> select Get attachment (v2) action.
Provide the below information
- Message Id: Select Message ID from dynamic content.
- Attachment id: Select Attachment attachment id from dynamic content. This will add another Apply to each action that will loop through attachments.

4. To save only PDF attachments in the SharePoint document library, for this, click on the +New steps -> select Create file action. Provide the below information:
- Site address: Provide the SharePoint site address
- Folder path: Provide the folder path
- File name: Select the Attachment name variable from dynamic content.
- File content: Select content bytes from dynamic content.

5. Now save the flow and run the flow manually. Then send an email to the Outlook inbox to trigger the flow.

You can flow runs successfully and the email attachment is saved to SharePoint with a different name.

This is how to save only PDF attachments to the SharePoint library using Power Automate.
Conclusion
In this Power Automate tutorial, I have explained how to save email attachments to SharePoint using Power Automate. This tutorial will help you to get attachments from email and save to the sharepoint document library using Power Automate. Also, it covers:
- Power Automate save email attachments to SharePoint with a different name
- Save email attachment to SharePoint in Power Automate.
- Power Automate save only PDF attachments
You may also like:
- Copy List Items To Another List In SharePoint Using Power Automate
- When a New Email Arrives Subject Filter in Power Automate
- Power Automate delete all files in SharePoint folder
- Power Automate Get items
- Auto Populate SharePoint List Columns Based on Value in One Column using Power Automate
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com