cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sahara22
Helper V
Helper V

How to automatically save Excel attachment in outlook and save to sharepoint list

Hello Everyone,

 

Looking on help on how to save an Excel attachment that sent daily through email and save it to one Sharepoint list.

 

-Sharepoint list has the same headers as Excel attachment 

-Need new items copied from email Excel attachment to replace and delete any old items on the share-point list to make sure I always have the most updated information.

-Same sender and email subject 

 

Any idea how to use power automate to do this?

 

Thank you! 

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Super User
Super User

Hi @Sahara22 

 

It's not a simple Flow, but we can try to do it. Do you already have something built?

 

I would do the following:

  1. Get all attachments and save them into a temporary folder.  Here's how to save all attachments when an email arrives. https://manueltgomes.com/microsoft/powerautomate/save-all-attachments-when-an-email-arrives/
  2. Then, open and get the data using the "Get a row" action for each of them. Here's how to access a dynamic path in Excel. https://manueltgomes.com/microsoft/powerautomate/how-to-access-dynamic-path-excel/
  3. This is the part is gets tricky. How do you know it's an "old item"? Does it have a common ID? The same name? What's the field that you can say that the row in Excel and the row in SharePoint list is the same? With that information, you can do a "Get Items" in your SharePoint list and check if that item exists or not. 
    1. If the item doesn't exist You can use the "Create Item" action to add the rows to your SharePoint list for each row.
    2. If the item exists you can do an "Update Item" with the new information.

 

Is this what you need?

 

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members finding the solution faster. If you like my response, please give it a Thumbs Up. 👍
Otherwise, reply to it, and the community will do its best to help you.

View solution in original post

5 REPLIES 5
manuelstgomes
Super User
Super User

Hi @Sahara22 

 

It's not a simple Flow, but we can try to do it. Do you already have something built?

 

I would do the following:

  1. Get all attachments and save them into a temporary folder.  Here's how to save all attachments when an email arrives. https://manueltgomes.com/microsoft/powerautomate/save-all-attachments-when-an-email-arrives/
  2. Then, open and get the data using the "Get a row" action for each of them. Here's how to access a dynamic path in Excel. https://manueltgomes.com/microsoft/powerautomate/how-to-access-dynamic-path-excel/
  3. This is the part is gets tricky. How do you know it's an "old item"? Does it have a common ID? The same name? What's the field that you can say that the row in Excel and the row in SharePoint list is the same? With that information, you can do a "Get Items" in your SharePoint list and check if that item exists or not. 
    1. If the item doesn't exist You can use the "Create Item" action to add the rows to your SharePoint list for each row.
    2. If the item exists you can do an "Update Item" with the new information.

 

Is this what you need?

 

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members finding the solution faster. If you like my response, please give it a Thumbs Up. 👍
Otherwise, reply to it, and the community will do its best to help you.

View solution in original post

Sahara22
Helper V
Helper V

Hello @manuelstgomes ,

 

Thank you for all your help.

 

The list is a roster of names and different departments there in. whole list changes daily but there are times that it could be the same employees name there. The main header names though is always the same.

 

I will try you method and get back to you.

 

Thanks!

Sahara22
Helper V
Helper V

So for the "/" where is it saving or do i need to save it to a file? also, for get a row, it is an excel sheet but then i need it send over to the sharepoint list.

 

Is there away I can save the excel sheet that comes in the email attachment  in a file in the one drive and everytime a new email comes have it replace  automatically? maybe thats easier? 

Sahara22
Helper V
Helper V

@manuelstgomes 

 

I actually figured it out, file is replaced because its the same file name, so that works.

 

The only thing is now the file is a list, not formatted as a table. Anyway power automate can download and format as table?

 

Thank you again for all your help! 

Sahara22
Helper V
Helper V

@manuelstgomes 

 

I figured that part to! thank you again for all your help! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,361)