How to delete all items from a SharePoint list using Power Automate?

Do you need to quickly delete all items from your SharePoint list using Power Automate? In this tutorial, we will see how to delete all items from a SharePoint list using Power Automate.

Also, we will see how to delete all items from the SharePoint list based on date using Power Automate. Then, we will see how to delete SharePoint list items older than 7 days in Power Automate.

As there are many reasons why we need to delete all items from the SharePoint list like the list is a test list and you don’t need it anymore, or the data is no longer required/relevant or you want to start with fresh data.

Whatever the reason will be, we can delete all items from a SharePoint list easily and quickly using Power Automate.

Now, let’s create a flow that will quickly delete all items from the SharePoint list in Power Automate

Delete all items from a SharePoint list using Power Automate

Here, we will see how to delete all items from the SharePoint list using Power Automate.

For example, I have a list, i.e., Product in SharePoint, and I need to delete items from this SharePoint list. This list contains 2 columns Title and price, which you can see in the below screenshot.

power automate delete all rows in sharepoint list

Let’s create the flow in Power Automate that will delete all SharePoint list items.

1. Open Power Automate Cloud, then click on the + Create icon -> select Instant Cloud flow.

sharepoint delete all items from list using power automate

2. Then provide the flow name, select Manually trigger a flow action, and then click on Create.

delete all items from sharepoint list power automate

You can see that Manually triggered flow action is added to the flow page.

how to delete all items in sharepoint list power automate

3. Now, we will get all items from the SharePoint list using Power Automate. For this, click on +New steps -> select Get Items action. Then provide the below information:

  • Site address: Provide the SharePoint site address
  • List name: Select the list from the dropdown.
delete all items in sharepoint list power automate

4. Now, we will delete all items from the SharePoint list; for this, click on the +New step -> select Delete item action. Then provide the below information:

  • Site address: Provide the SharePoint site address
  • List name: Select the list from the dropdown.
  • Id: Select the id from the dynamic content. This will automatically add Apply to each action to the flow as we are working on multiple items.
Microsoft power automate delete all items in sharepoint list

5. Now run the flow manually; you can see all items are deleted from the SharePoint list using Power Automate.

delete all items from sharepoint list in power automate

This is how to delete all items from the SharePoint list using Power Automate.

See also  How to replace text in a Word document in Power Automate?

Delete items from the SharePoint list based on date using Power Automate

Here, we will see how to delete all items from the SharePoint list based on date using Power Automate.

For example, we have a list of events in SharePoint list called “Events,’ and we need to delete events that will happen on 10-12-2023. For this, I have created an Instant cloud flow that will take the date as an input and trigger manually and then get the items from the SharePoint list based on the input date and delete all items from the SharePoint list.

The Events list contains columns like

  • Title -Single line of text
  • Event date-Date/Time
  • Attendees-Person
  • Organizer- Person
delete all items in sharepoint list using power automate

Now, let’s create a flow that will delete SharePoint list items based on date using Power Automate.

Step 1: Open Power Automate Cloud, then click on the +Create icon -> select Instant Cloud flow.

delete all items from sharepoint list based on date power automate

Then, provide the flow name, select Manually trigger a flow, and then click on Create.

delete all items from sharepoint list based on date Microsoft power automate

Now you can see that Manually triggered flow action is added to the flow page. Next, click on +Add an input icon, and then select the Date option like below.

power automate delete items from sharepoint list based on date

Step 2: Next, we will get items whose date is 10-12-2023, click on the +New step and then select the Get items action, and then provide the below information:

  • Site address: Provide the SharePoint site address
  • List name: Select the list from the dropdown.

Then click on Show Advanced options:

  • Filter query: Provide the below query:
Eventdate eq '@{formatDateTime(triggerBody()['date'], 'yyyy-MM-dd')}'
Microsoft power automate delete items from sharepoint list based on date

Step 3: Now we will delete items based on the given date, so click on the +New step -> select Delete item action. Then, provide the information below.

  • Site address: Provide the SharePoint site address
  • List name: Select the list from the dropdown.
  • Id: Select the id from the dynamic content. This will automatically add Apply to each action to the flow as we are working on multiple items.
power automate delete all items from sharepoint list based on date

Step 4: Now run the flow and provide the date, and you can see the items are deleted from the SharePoint list, whose date is 10-12-2023.

 delete items from sharepoint list based on date Microsoft power automate

This is how to delete all items from the SharePoint list based on the date using Power Automate.

See also  How to Convert String to Date for SharePoint list using Power Automate?

Delete SharePoint list items older than 7 days using Power Automate

Here, we will see how we can delete list items older than 7 days using Power Automate.

For example, we will take the same SharePoint Event list, and we will check if the Event date is older than 7 days or 1 week from today. Then, we will delete all those events from the SharePoint list.

For this, we will create an Instant cloud flow and then get items older than 7 days. After that, we will delete all items from the Sharepoint list.

delete all items from sharepoint list older than 7 days in power automate

Now let’s create a flow, that will delete all SharePoint list items that are older than 7 days using Power Automate.

Step 1: Open Power Automate Cloud, then click on the +Create icon -> select Instant Cloud flow.

delete all items from sharepoint list older than 7 days power automate

Step 2: Then, provide the flow name, select Manually trigger a flow action, and click Create.

delete all items from sharepoint list older than 7 days Microsoft power automate

Now you can see that Manually triggered flow action is added to the flow page in Power Automate.

how to delete all items in sharepoint list power automate

Step 3: Next, we will get items that are older than 7 days. click on the +New step and then select the Get items action, and then provide the below information:

  • Site address: Provide the SharePoint site address
  • List name: Select the list from the dropdown.

Then click on Show Advanced options:

  • Filter query: Provide the below query:
Eventdate le '@{addDays(formatDateTime(utcNow(), 'yyyy-MM-dd'),-7)}'
power automate delete all items in sharepoint list older than

Step 4: Now we will delete items that are older than 7 days, so click on the +New step -> select Delete item action. Then, provide the below information.

  • Site address: Provide the SharePoint site address
  • List name: Select the list from the dropdown.
  • Id: Select the id from the dynamic content. This will automatically add Apply to each action to the flow as we are working on multiple items.
power automate delete all items in sharepoint list older than 7days

Step 5: Now run the flow, and you can see the items that are deleted from the SharePoint list are older than 7 days.

delete all items from sharepoint list older than 7 days using power automate

This is how to delete all items that are older than 7 days using Power Automate.

See also  Download files from SharePoint to Local Drive using Power Automate

Conclusion

I hope now you have a complete idea of how to delete items from the SharePoint list using Power Automate. Also, we cover the below topics

  • Power Automate delete items from the SharePoint list based on the date
  • Power Automate delete SharePoint list items older than 7 days

You may also like:

  • This worked, but only deleted the first 100 list items? Is there a way to delete all 500 list items that are in my list?

  • I am also having a list with 15k (Part no data) i have to delete from time to time.
    Here only first 100 items are getting deleted, as Scott described too.

  • >