Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Get data from excel to sharepoint list then delete the excel file that was read

(0) ShareShare
ReportReport
Posted on by 16
Hi,
 
I have a working flow that lists the rows present in a table from an existing document and then uploads data from the excel file onto the sharepoint list. Now, I need to create a trigger for when an email arrives that extracts the data from the excel file in the attachment, and then I need to delete the excel file that was just read. Thanks!
 
 
  • CU31101853-0 Profile Picture
    CU31101853-0 16 on at
    Get data from excel to sharepoint list then delete the excel file that was read
     
    Hi,
     
    So I receive a daily automated email from Outlook and the attachment is an excel sheet. I am trying to have my flow turn the sheet into a table, upload it to a document library on Sharepoint, then export the data in the tables to a Sharepoint list. Since I receive the email daily, I then want on my flow an action that will replace/delete the data in the Sharepoint list with the new data. 
     
     
    Thanks!
  • Nived_Nambiar Profile Picture
    Nived_Nambiar 17,110 on at
    Get data from excel to sharepoint list then delete the excel file that was read
     
    I am not clear - i hope as per your question - you need to delete the file right ?
     
     
    Thanks & Regards,
    Nived N
  • CU31101853-0 Profile Picture
    CU31101853-0 16 on at
    Get data from excel to sharepoint list then delete the excel file that was read
     
    Hi,
     
    Thanks so much. The only problem I am having with the flow is that it is completely deleting the list. Is there a way to just delete the data in the Sharepoint list, since I will be receiving new data every morning?
     
    Thanks,
     
    Anthony
  • Suggested answer
    Nived_Nambiar Profile Picture
    Nived_Nambiar 17,110 on at
    Get data from excel to sharepoint list then delete the excel file that was read
    Hi 
     
    Try like per the below flow:
     
    This flow triggers when email arrives in mailbox, reads the excel data & create sharepoint list and then deletes the excel file.
     
    1. after the trigger, use the filter array action to remove the inline attachments 
     
     
    2. use apply to each to loop through the filtered attachments array (output of filter array action)
     
     
    next steps will be explained under apply to each loop
     
    2.1: use get attachment content to get file content.
     
     
    2.2 use create file action to create the file using attachment content
     
    2.3: use get tables action to get list of tables from created file
     
     
    2.4: use list rows present in table to list out all rows in created table.
     
    Expression: 
    first(outputs('Get_tables')?['body/value'])?['id']
     
    2.5: use apply to each loop again to loop through excel data to create list item
     
    2.6: next after items are created, outside loop, use delete file action to delete the file using its ID parameter.
     
     
    Hope it helps !
     
    Mark it as solution if it resolves your query !
     
    Thanks & Regards,
    Nived N

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard