cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CatPagulayan
Helper IV
Helper IV

Flow that deletes items in a sharepoint list when it reaches 10 records

I have a sharepoint list where I only want to maintain 10 records always, so at the 11th record, those items 1 to 10 will be automatically deleted, and at the 21st record, all those entries from record 11 to 20 will be deleted. Appreciate the help to create a flow for this.
Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @CatPagulayan 

 

In your screenshot your filter query is showing just a value of 25.

You need to have a column than value, like in my example.

 

Furthermore, my example only allows 10 items to be available at a time.

 

Did you want there to be only IDs based on the IDs + 10?

Like IDs 1-10, 11,21, 22,32


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

6 REPLIES 6
Jcook
MVP

Hello @CatPagulayan 

 

Please take a look at this:

 

Jcook_2-1597698999922.png

 

 

 

Jcook_1-1597698920972.png

 

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Screenshot_20200818-105727_Viber.jpg

 hi @Jcook , thanks for your help but I tried and followed the flow but seems it gets an error from the get items part. I am not sure if flow is able to know how many entries I have entered and is basing only from the ID. I've had some tests already and deleted them so the starting ID of my list is at 21. I tried doing in 3s first so I am expecting it is deleting the first 3 I have entered (I have entered 5 items now and seems nothing is getting deleted. The ID in sharepoint though starts at 21 (so i have IDs 21 to 25), my expectation is that it will delete items from ID 21 to 23). Appreciate your help 🙂

Hi @CatPagulayan 

 

In your screenshot your filter query is showing just a value of 25.

You need to have a column than value, like in my example.

 

Furthermore, my example only allows 10 items to be available at a time.

 

Did you want there to be only IDs based on the IDs + 10?

Like IDs 1-10, 11,21, 22,32


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Hello @Jcook , so this is my sharepoint list sample:

IMG-e484313b93c1b6f006abf72ec20ae0a8-V.jpg

 for that example, I only want to retain say 3 items to make it simpler. so the first 6 items (say from ID 21 to 26) should be deleted. Then when I enter another entry after ID 29 - so that will be ID 30, entry/row under ID 27 will be deleted so that what remains are entries under ID 28, 29, 30 and so on. so the maximum entries in the sharepoint in this case should be 3 most recent items only. Is that possible? thanks in advance!

Hi @CatPagulayan 

 

Yes, follow my example above and change the value in the condition from 10 to 4

 

This value is not the ID it is the Length of items. Please try and re create the flow I have shown. It does exactly as you describe.


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





You are correct @Jcook ! It worked like a charm! 🙂 thanks very much for your help in this!!

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!

Users online (2,318)