web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract data from emai...
Power Automate
Answered

Extract data from email attachement (excel file) and add to excel table in sharepoint

(0) ShareShare
ReportReport
Posted on by 25

I receive data files on a regular basis in my outlook dropbox. I would like to transfer the data from these files automatically everytime i recieve a new e-maile with an excel file. The data has to go into a table in an excel file in share point.

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    Hello,

     

    Step 1. Create an Automated Flow

    Step 2. Use the When an Email Arrives Trigger

    Step 3. Add an HTML to Text Action, with the input being the body of the email trigger. I am assuming the URL is somewhere in the body 

    Step 4. Parse the email. There are way too many unknowns here, so I will leave it at this.

    Step 5.  Use Get File Content or Get File Content by Path from DropBox action

    Step 6. Use Create Item (SharePoint Action) using the content from Step 5 to create a copy of the file from dropbox into SharePoint (or use the Onedrive Create item).  You need this because you want to read the Table data from the file in Dropbox but you have to move it first. You can delete it after

    Step 7. (Optional) IF your new file, doesn't have an Excel table, you need to use the Create Table (Excel Action) on the file you created in Step 6. If it has a Table then Skip this and go to Step 8.

    Step 8. Use the List rows in a Table (Action Excel) 

    Step 9. Use an Apply to Each to loop through the rows returned in Step 8.

     

    Step 10. Use an Add row to table (Excel Action) to write the rows (in the loop) to your Excel file in sharepoint. Please note you didn't say you wanted to move the file there and write data, you said write the data to "an excel file" so I assume the data you get and the "excel file" in sharepoint are different

     

    Step 11. Once you are done, you can use Delete File to delete the temporarily created file in SharePoint (or onedrive, doesnt matter as long as its one of those for the Excel actions to work)

     

    Here is an Image

    FLMike_2-1695311770149.png

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

     

     

  • Lasse4 Profile Picture
    25 on at

    Sorry @FLMike  but it made a mistake in my explanation of the problem. I don't receive the excel files in dropbox. I receive the in my outlook inbox... 

    When the excel files arrive I would like the data in them to automatically be transfered to a table in share point. The data from the different excel files will have to go into the same table in a specific excel sheet in sharepoint.

    Also, the data in the files i receive are always in the same cells, but they are not in a table in these files.

    Hope you still want to help 🙂

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    Hi,

     

    I sorry, I am still confused sorry. You keep saying "Table" in SharePoint. Which means an Excel file with a Table in a file that you store in SharePoint(aka master file), but I thought you wanted them in a SharePoint List?

     

    So I am still going to assume you do NOT need a master file, because you are always writing the incoming file to a SharePoint List, NOT a single (master) file.

     

    Here is what it looks like now

    Step 1. Trigger Email Arrives

    Step 2. loop through attachments (Apply to each condition) using Attachments from Trigger

    Step 3. use a Condition to validate that the Attachment file name is the xlsx you want (or you can use a pattern, or you can put a filter on the Trigger for the attachment as well). I put this here for teaching too

     

    Step 4. Once you find the attachment, write it to SharePoint (you can delete it later if you want)

    Step 5. Use the Create Table to make the required table in the file

    Step 6. List the rows in the Table

    Step 7. Create an Apply to each to LOOP through the values in Step 6 using value (dynamic property)

    Step 8. Use Get Items to "validate" if a Row exists or NOT in SharePoint list already

    Step 9. Use a condition to validate that there was 1 row. You use the length(against the Step 8 body array length)

    Step 10a. No Condition, do a Create Item into List as its a new row

    Step 10b. Yes Condition, do an Update item based on the ID you get from Get Items array. Remember there is only 1 row, so you dont need to LOOP you can use Array notation etc to get the Row/record in Step 8 directly. You COULD use an Apply to each to loop but its a single loop.

     

    FLMike_1-1695485764704.png


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

     

     

  • Lasse4 Profile Picture
    25 on at

    Hi, sorry again for the unclear explanation. What i meant by table is a master excel file in which I would like to have a table that all the data from the different excel email attachements are added 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard