cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

delete all list items

Dear community,

 

I have created a SharePoint List where users can register themself as a visitor through a power app. 
At the end of the day I would like to clean this list by using a microsoft flow.

I already found the schedule function to trigger the flow at 0:00am. But there is no function to delete all the list items in a sharepoint list. Unfortunately  I could only find to delete one item, that needs to be specified as an unique id.

 

Does anyone now a quick solution to this? Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I have found the solution. I combined the "get items" and "apply each" operator.
For people who are interested, see https://docs.microsoft.com/en-us/flow/apply-to-each.

Here is an overview of my solution

 

msflow.JPG

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

I have found the solution. I combined the "get items" and "apply each" operator.
For people who are interested, see https://docs.microsoft.com/en-us/flow/apply-to-each.

Here is an overview of my solution

 

msflow.JPG

Hi. I just tried your method. It is sporadically deleting items and misses many.  Strange.

All,

 

I need some help please.  I have unsubscribe email account that by its nature will trigger a flow that I want to delete that persons data from some SharePoint lists.  I have limited knowledge of the delete items action in o365 SharePoint.  What do I need to do to make the flow work below? 

 

 Unsubscribe.png

 

The list has multiple fields and all should be deleted as part of the process.

 

Can someone please give me some guidance.

 

Regards

 

Andrew

Shin
Frequent Visitor

in the Get Items section of your flow, try setting the number really high. The "Default" says it will get all items, however; it doesn't work. Instead set a item limit well beyond the total in the list to get a more consistent result.

Same issue here.

 

Even if I try to select all items in SharePoint page and I click Delete. It won't delete everything....

 

 

Just to clarify. The field is Top Count:

Untitled.png

You also need to switch on pagination in the action's settings (right clip on the ellipse) or it will only pick up the first 100 items

AbhijeetPhx
New Member

I understand this is an old issue, but I am still seeing a similar issue in sharepoint online.

In my list, I don't have many items so it deletes all successfully but then I get "Item does not exist" and workflow fails. Would really appreciate any help, thanks!

 

Item does not exist.

The page you selected contains an item that does not exist. It may have been deleted by another user.
clientRequestId: XXXX serviceRequestId: XXXX

 

 

AbhijeetPhx_0-1637335917391.png

 

Rodolfo1840
Advocate III
Advocate III

An alternative (if you are allowed), it's delete them programatically via PowerShell - https://www.crowcanyon.help/article/338/ 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,037)