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

Posted on 4 Nov 2024 16:13:11 by 6
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 6 on 26 Nov 2024 at 14:59:20
    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 16,505 on 04 Nov 2024 at 18:29:17
    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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,129

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,797

Leaderboard