How to Save Email Attachment to SharePoint using Power Automate?

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.
power automate save email attachment to sharepoint

2. Add a new step and choose an apply to each control; choose the Attachments from the dynamic content value.

power automate save attachment to sharepoint

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']
save my email attachments to a sharepoint document library

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'))
outlook rule to save attachment to sharepoint

Our complete flow looks like below:

automatically save outlook attachments to sharepoint

3. Save and test the flow. Here, I have sent an email with an attachment from a testing user ID.

save email attachment to sharepoint using power automate flow

The flow triggers automatically and runs successfully. Then, it saves the attachment on the mentioned Shared document folder path with the attachment content.

save email attachment to sharepoint using power automate

This is how to save the Attachments from email to SharePoint using Power Automate Flow.

See also  Power Apps SharePoint Button

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.
power automate save email attachment to sharepoint

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].

save email attachment to sharepoint power automate flow

If yes, choose an apply to each control, and choose the Attachments from the dynamic content value.

power automate save attachment to sharepoint

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']
save email attachment to sharepoint power automate

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'))
save attachment to sharepoint power automate

If no, leave it blank.

Our complete flow looks like below:

save outlook email to sharepoint power automate

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]).

save all attachment from outlook to sharepoint folder using power automate

The flow triggers automatically and saves all the attachments in the mentioned Patti Fernandez folder.

save all attachment from outlook to sharepoint folder using power automate flow

Test case -2:

Here I have sent an email with an attachment from a different user ID.

power automate save attachment from email to sharepoint document library

The flow runs successfully, and the condition returns false, and it doesn’t create any files in the mentioned folder path.

save attachment from outlook to sharepoint folder using power automate

This is how to save the Attachments from email to SharePoint using Power Automate Flow.

See also  SharePoint Online Microsoft Forms Web part

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.
power automate save email attachment to sharepoint

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.

power automate when a new email arrives subject filter contains

If yes, select an apply to each control, and choose the Attachments from the dynamic content value.

power automate save attachment to sharepoint

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']
save email attachment to sharepoint power automate

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'))
How to save attachment from outlook to sharepoint power automate

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.

save outlook email to sharepoint power automate flow

If yes, select an apply to each control, and select the Attachments from the dynamic content value.

power automate save attachment to sharepoint

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']
save email attachments to sharepoint power automate flow

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'))
power automate save attachment from email to sharepoint

If no, leave it blank.

See also  Power Automate copy files with Examples

Our complete flow looks like below:

How to save my email attachments to a sharepoint document library using Flow

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.

save my email attachments to a sharepoint document library using Power Automate

So, if the condition is satisfied, it saves the attachments to the mentioned document library.

save my email attachments to a sharepoint document library using Power Automate flow

Test case -2:

Similarly, I have sent an email with an attachment and the Subject Line containing Finance.

save email attachment to sharepoint folder using power automate flow

So, if the condition is satisfied, it saves the attachments to the mentioned document library.

save email attachment to sharepoint folder using power automate

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:

  • 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?

  • >