cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Help needed - Flow that saves an email attachment to SharePoint Online

Granted, I'm not the most ingenious Flow user but after enough hours of hitting my head aginst the wall, I'm coming here for help. This is what I want to accomplish:

 

- Flow that saves email attachments to a specified SharePoint Online document library.

- Flow is activated when an email originates from a certain domain (for example all emails sent from outlook.com or company.com).

- Email has an attachment/attachments. All file types applicable.

- Destination in the SPO document library correlates with the sender's domain (in this example Company or Outlook). Idea is to save all customer files to the specified customer folder in SPO.

- I'm using Exchange Online if that info is viable.

 

So. How is a Flow like this made? It is vital that the sender's domain is a trigger, not just some specific email address. I specifically want to make a Flow that saves attachments from a certain customer to SPO.

 

----------------------------------------------
Check out my Project Operations and Power Automate blog at:
https://daytodaydynamics365.com
2 ACCEPTED SOLUTIONS

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @anttipajunen,

 

You may take a look at the following template first

Save my email attachments to a SharePoint document Library

If you would like to save the attachments from special Email, then we could take use of condition to filter the Email arrived:

Add a condition to a flow

 

For SharePoint document library, as Microsoft Flow uses connection to connect to data source, it would require you to first sign-in SharePoint Online, after that, specify the SharePoint site URL (which I don't think dynamic content could be used here), then click the folder icon to find the proper folder path.

 

For different user save to different SharePoint library folder, currently I don't think that is available.

 

In addition, you could get some documentation for Microsoft Flow from the site below:

Microsoft Flow documentation

If you have any further questions, please post back.

Regards

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

^ thanks!

 

I actually solved this by looking at the exisiting template. Solution is:

 

1. Outlook action "when a new email arrives".

Has attachment and include attachments have been set to "Yes"

 

2. Condition

Object name = Outlook field From

Relationship = contains

Value = the domain from which the emails originate from

 

3. IF YES ->

 

4. Apply to each nees to be set here

Select an output from previous steps =Outlook's Attachments

 

5. Then set a SharePoint Create file

Site address is the SPO site collection in question

Folder path is the document library folder

File Name = Oulook field Name

File Content = Outlook field Content

 

It takes 2-5 minutes for the file to appear in SharePoint Online.

----------------------------------------------
Check out my Project Operations and Power Automate blog at:
https://daytodaydynamics365.com

View solution in original post

14 REPLIES 14
Ariel_Mendez
Regular Visitor

I have almost the same situation. I want to save the attachment that comes from specific email address with specific subject. This attachment have to replace a file in SharePoint.

 

Once this is done I will like to do another flow to open an Excel file and update the queries in it.

 

Found this tamplate: "Save my email attachment to SharePoint and get notifications" I have no clue of how to use it. I'm frustrated with this and about to quit and offer my boss another solution to automate this kind of process.

^ well I'm dying to know if that Excel query works - I have a strong feeling it isn't possible with Flow. But what if the data was in an SQL in Azure? Just saying out loud the first thing that comes to mind around the subject.

----------------------------------------------
Check out my Project Operations and Power Automate blog at:
https://daytodaydynamics365.com

If I could have the inormation in an SQL, Azure or other database, that will probably will be manage by the IT staff of my institution and therefore I will have no need to use flow. The issue here is that I´m trying to get data updated without the appropiate tools. If Microsoft actually want to empower the common user like me, I should be able to update my reports using simple tools. Already I´m able to update my reports in Excel using queries that looks for the information in an .csv file. Now I want to make it automatic with Flow. So far I´m strongly motivated to quit flow and do the automation with python.
Ariel_Mendez
Regular Visitor

Found another template: "Save my email attachment to SharePoint library". It should work, but so far haven´t found the way to make it work. I gues I need more time or more coffe.
v-micsh-msft
Community Support
Community Support

Hi @anttipajunen,

 

You may take a look at the following template first

Save my email attachments to a SharePoint document Library

If you would like to save the attachments from special Email, then we could take use of condition to filter the Email arrived:

Add a condition to a flow

 

For SharePoint document library, as Microsoft Flow uses connection to connect to data source, it would require you to first sign-in SharePoint Online, after that, specify the SharePoint site URL (which I don't think dynamic content could be used here), then click the folder icon to find the proper folder path.

 

For different user save to different SharePoint library folder, currently I don't think that is available.

 

In addition, you could get some documentation for Microsoft Flow from the site below:

Microsoft Flow documentation

If you have any further questions, please post back.

Regards

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

^ thanks!

 

I actually solved this by looking at the exisiting template. Solution is:

 

1. Outlook action "when a new email arrives".

Has attachment and include attachments have been set to "Yes"

 

2. Condition

Object name = Outlook field From

Relationship = contains

Value = the domain from which the emails originate from

 

3. IF YES ->

 

4. Apply to each nees to be set here

Select an output from previous steps =Outlook's Attachments

 

5. Then set a SharePoint Create file

Site address is the SPO site collection in question

Folder path is the document library folder

File Name = Oulook field Name

File Content = Outlook field Content

 

It takes 2-5 minutes for the file to appear in SharePoint Online.

----------------------------------------------
Check out my Project Operations and Power Automate blog at:
https://daytodaydynamics365.com

Finally it worked; I was able to save specific attachament in SharePoint. Thanks a lot.

Hi @anttipajunen and @Ariel_Mendez,

 

Glad to hear that.

If you have any further questions regarding Microsoft Flow usage, please feel free to post back.

Besides, it would be very appreciate if you could accept the proper posts as the solution, which should be helpful for the others who may have the same question.

 

Regards.

Michael Shao

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am not able to make this work on a specific folder in my Inbox. The trigger never fires. It works find in the Inbox itself.

Dev_Nikhil
Advocate III
Advocate III

Hello,

Can we save the Attachment and Also Some other Data of E-mail in List/Library? 

for ex. I have a Mail in Inbox i have to Save its Attachment in One Library.

at the Same time i also want to save the Detailes of Mail Which we can get via Email (Like email ID, Subject, Body)

into same List/Library where the Attchments is.

 

Can it will be Possible ?

 

Thanks You in Advance

admincomm
Regular Visitor

I was able to successfully save attachments to SPO. However, if someone sends me an inline attachment, it would not be saved. Any solution to this?

@Dev_Nikhilget you find a solution to this? 

Yes @Basic_User007 , i have the Solution i am using two actions one for Creating an Item in SharePoint List and other one for storing Attachment into the SharePoint Document Library. If you have any other scenarios then also i would like to describe it with screen shots.

@Dev_Nikhil  If you are able to share your Flow steps via screenshots please do as I would be interested to see this. 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,236)