Do you need to save email attachment to SharePoint using Power Automate?
In this Power Automate tutorial, I have explained how to save email attachments to SharePoint using Power Automate. We can use Power Automate to automatically save Outlook attachments to a SharePoint document library.
Here, I will show three examples of saving attachments from Outlook to SharePoint using Power Automate.
- First example: we will save email attachments directly to the SharePoint document library.
- Second example: We will check the condition if the from address of the email is equal to the particular user, then it automatically saves Outlook attachments to SharePoint to the Particular folder using flow.
- Finally, in 3rd example, we will check the condition if the subject filter contains the value, then save the attachment to the SharePoint library using Power Automate to a selected folder.
Now, let us create a flow to save my email attachments to a SharePoint document library using Power Automate.
Power Automate save email attachment to SharePoint
Let us see how to save the attachments from email to SharePoint using Power Automate Flow.
Example -1: (Directly saves to the Shared documents)
1. Create an automated cloud flow, and choose the trigger When a new email arrives (V3) action from action triggers. Choose the Parameters as highlighted below:
- Folder: Click on the Show Picker icon and choose the inbox option.
- Include Attachments: Select the yes option.
2. Add a new step and choose an apply to each control; choose the Attachments from the dynamic content value.
Add a compose data operation and add attachment content value from the dynamic content to get the attachment content presented in the attachments.
items('Apply_to_each')?['contentBytes']
From the action trigger, choose the create file option for SharePoint.
- Site Adress: Select the site address from the drop-down list.
- Folder Path: Select the folder path from the Show Picker icon. Here, I have selected my (Shared Documents)
- File Name: Select the Attachment file name from the Dynamic content.
- File Content: Pass the output of the compose data operation from dynamic content
base64ToBinary(outputs('Compose_2'))
Our complete flow looks like below:
3. Save and test the flow. Here, I have sent an email with an attachment from a testing user ID.
The flow triggers automatically and runs successfully. Then, it saves the attachment on the mentioned Shared document folder path with the attachment content.
This is how to save the Attachments from email to SharePoint using Power Automate Flow.
Example -2: (Checks From address is equal to the particular user)
Now let us create a flow if the from address is equal to the particular user using Power Automate flow.
1. Create an automated cloud flow and select the trigger When a new email arrives (V3) action from action triggers. Provide the below Parameters as highlighted below:
- Folder: Click on the Show Picker icon and choose the inbox option.
- Include Attachments: Select the yes option.
2. Add a new step and choose a condition action; check the condition if the From address is equal to the Particular email address. I have selected the user email address [email protected].
If yes, choose an apply to each control, and choose the Attachments from the dynamic content value.
Select a new step, add a compose data operation, and add attachment content value from the dynamic content to get the attachment content presented in the attachments.
items('Apply_to_each')?['contentBytes']
Then, choose the create file option for SharePoint.
- Site Adress: Select the site address from the drop-down list.
- Folder Path: Select the folder path from the Show Picker icon. Here I have selected my (Folder Name called: Patti Fernandez)
- File Name: Select the Attachment file name from the Dynamic content.
- File Content: Pass the output of the compose data operation from dynamic content
base64ToBinary(outputs('Compose'))
If no, leave it blank.
Our complete flow looks like below:
3. Save and test the flow. Click on the Run flow option.
Test case-1:
Here I have sent an email with multiple attachments from the mentioned user ID ([email protected]).
The flow triggers automatically and saves all the attachments in the mentioned Patti Fernandez folder.
Test case -2:
Here I have sent an email with an attachment from a different user ID.
The flow runs successfully, and the condition returns false, and it doesn’t create any files in the mentioned folder path.
This is how to save the Attachments from email to SharePoint using Power Automate Flow.
Example -3: (subject filter contains the value)
Now let us see how to save the Attachments from email to SharePoint by applying the subject filter containing the value using Power Automate flow.
1. Create an automated cloud flow, and choose the trigger When a new email arrives (V3) action from action triggers. Enter the details as highlighted below:
- Folder: Click on the Show Picker icon and choose the inbox option.
- Include Attachments: Select the yes option.
2. Add a new step and choose a condition action; check the condition Subject Contains HR. Choose a Subject value from the dynamic content value.
If yes, select an apply to each control, and choose the Attachments from the dynamic content value.
Add a compose data operation, and add attachment content value from the dynamic content to get the attachment content presented in the attachments.
items('Apply_to_each')?['contentBytes']
Then, choose the create file option for SharePoint.
- Site Adress: Select the site address from the drop-down list.
- Folder Path: Select the folder path from the Show Picker icon. Here, I have selected my (Folder Name called HR Documents)
- File Name: Select the Attachment file name from the Dynamic content.
- File Content: Pass the output of the compose data operation from dynamic content
base64ToBinary(outputs('Compose'))
If no, leave it blank.
3. Add a new step and choose a condition action; check the condition Subject contains Finance. Select the subject value from the dynamic content. Also, set the configure run after has failed, is skipped, and has timed out.
If yes, select an apply to each control, and select the Attachments from the dynamic content value.
Add a compose data operation, and add attachment content value from the dynamic content to get the attachment content presented in the attachments.
items('Apply_to_each_2')?['contentBytes']
Then, choose the create file option for SharePoint.
- Site Adress: Select the site address from the drop-down list.
- Folder Path: Select the folder path from the Show Picker icon. Here, I have selected my (Folder Name called: Finance Documents)
- File Name: Select the Attachment file name from the Dynamic content.
- File Content: Pass the output of the compose data operation from dynamic content
base64ToBinary(outputs('Compose_2'))
If no, leave it blank.
Our complete flow looks like below:
4. Save and test the flow by selecting the Run Flow option.
Test case-1:
I have sent an email with an attachment and the Subject Line containing HR.
So, if the condition is satisfied, it saves the attachments to the mentioned document library.
Test case -2:
Similarly, I have sent an email with an attachment and the Subject Line containing Finance.
So, if the condition is satisfied, it saves the attachments to the mentioned document library.
This is how to save attachments from Outlook to SharePoint by applying the subject filter containing the value using Power Automate flow.
Conclusion
I hope you know how to automatically save Outlook attachments to the SharePoint document library using Power Automate.
Here, I have shown you three different examples. in the first example, I have shown you how we can directly save my email attachments to a SharePoint document library.
In the second example, I have shown you how to Check From address is equal to the particular user and save an attachment to the mentioned SharePoint folder.
In the third example, I have shown you an example of how to save attachments from email to SharePoint by applying the subject filter containing the value using Power Automate flow.
You may also like:
- Power Automate create an HTML table from SharePoint List
- Power automate approval reminder
- Power Automate send an email with an attachment from SharePoint
- Power Automate update SharePoint list item
- How to Stop Flow in Power Automate?
- How to Send Email based on Date in SharePoint list using Power Automate?
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
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?