web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow that deletes item...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 184

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!

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hello @CatPagulayan 

     

    Please take a look at this:

     

    Jcook_2-1597698999922.png

     

     

     

    Jcook_1-1597698920972.png

     

     

  • CatPagulayan Profile Picture
    184 on at

    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 🙂

  • Verified answer
    Jcook Profile Picture
    7,781 Most Valuable Professional on at

    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

  • CatPagulayan Profile Picture
    184 on at

    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!

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    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.

  • CatPagulayan Profile Picture
    184 on at

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard