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

Anonymous
Not applicable

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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,279)