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 / Bulk Delete/Create Ite...
Power Automate
Suggested Answer

Bulk Delete/Create Item on Sharepoint List

(0) ShareShare
ReportReport
Posted on by 16
Hi, 
 
I receive a daily email with an excel attachment with 3,500 rows of data. I noticed with my current flow, it takes a long time/time's out because of the large data set. Is there a way to do a bulk delete of all of the data and create new data with this amount? I want the flow to delete the sharepoint list and update it with the new data on the sharepoint list every day. 
 
Thanks,
 
Anthony
Categories:
I have the same question (0)
  • Suggested answer
    Robu1 Profile Picture
    1,459 Super User 2025 Season 2 on at
    Hi  /Anthony,
     
    Thank you for choosing Microsoft Community.
     
    You can definitely streamline your process to handle large datasets more efficiently.
     
    Here’s a step-by-step guide to create a flow that deletes all items in a SharePoint list and updates it with new data from your daily email attachment:
     
    Trigger: Use the "When a new email arrives" trigger in Power Automate to start the flow when you receive the email with the Excel attachment.
     
    Get Attachment: Use the "Get attachment" action to retrieve the Excel file from the email.
     
    Delete Existing Items:
    Use the "Get items" action to retrieve all items from the SharePoint list.
     
    Add an "Apply to each" loop to iterate through the items.
    Inside the loop, use the "Delete item" action to delete each item. For large lists, consider using the SharePoint Batch API for better performance.
     
    Read Excel Data:
    Use the "List rows present in a table" action to read the data from the Excel file. Ensure your Excel file has a table defined.
     
    Add New Items:
    Add another "Apply to each" loop to iterate through the rows of the Excel table.
    Inside the loop, use the "Create item" action to add each row to the SharePoint list.
     
    Here’s a more detailed breakdown:
     
    Trigger:
    Use "When a new email arrives" (V3) trigger.
    Set the filter to only trigger on emails with the specific subject or from a specific sender.
     
    Get Attachment:
    Use "Get attachment" (V2) action.
    Specify the message ID and attachment ID from the trigger.
     
    Delete Existing Items:
    Use "Get items" action to retrieve all items from the SharePoint list.
     
    Add an "Apply to each" loop to iterate through the items.
    Inside the loop, use the "Delete item" action to delete each item.
    For large lists, consider using the SharePoint Batch API for better performance.
     
    Read Excel Data:
    Use "List rows present in a table" action to read the data from the Excel file.
    Ensure your Excel file has a table defined.
     
    Add New Items:
    Add another "Apply to each" loop to iterate through the rows of the Excel table.
    Inside the loop, use the "Create item" action to add each row to the SharePoint list.
     
    This approach should help you efficiently delete and update your SharePoint list with new data daily.    If you need more detailed steps or run into any issues, feel free to ask!
     
    If this Post helped you, please click  "Does this answer your question" and like this post to help others in the community find the answer too!

    Happy to help 
    Robu 1
  • CU31101853-0 Profile Picture
    16 on at
     
    Hello,
     
    I appreciate the information. What exactly is the Sharepoint Batch API. I have had the flow basically to the tee, before you posted, I am just running into a timeout error because of the amount of rows being uploaded/deleted from Sharepoint.
     
    Thanks,
     
    Anthony
  • Suggested answer
    takolota1 Profile Picture
    4,974 Moderator on at

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard