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 Apps / collection not updating
Power Apps
Unanswered

collection not updating

(0) ShareShare
ReportReport
Posted on by 150

I am using this formula for deletion and update of collection ClearCollect(colWithNumber, RemoveIf(colWithNumber, ID <= 24)); but   it is removing all the item from the collection.

Categories:
  • SagarVIS96 Profile Picture
    212 on at

    Hi @Moira0509 ,

     

    You can use the following:

    RemoveIf(colWithNumber, ID <= 24)

     

    No need to write ClearCollect() function over here.

    Thanks

     

  • Moira0509 Profile Picture
    150 on at

    But when I am using this 

    RemoveIf(colWithNumber, ID <= 24)

    It is not updating the collection.

     

  • SagarVIS96 Profile Picture
    212 on at

    Hi, @Moira0509 
    Ideally it should work, let's say if you have gallery where you want display the collection data. So, in this case we can write this code on OnSelect() of button and directly pass the collection data to the gallery. So, it will remove the items and will automatically update the collection.

    Thanks

  • Moira0509 Profile Picture
    150 on at

    So  this code i should use in onselect of gallery not in button ? 

    RemoveIf(colWithNumber, ID <= 24)

     I am using button outside the gallery and then formulating this..

  • SagarVIS96 Profile Picture
    212 on at

    Hi @Moira0509 ,
    I have attached a demo of updating the collection. Please have a look in this.Update Collection.gif

  • Moira0509 Profile Picture
    150 on at

    Yeah I am using  this RemoveIf(colWithNumber, ID <= 24); but the thing is that the items that are starting from id 25 are not getting updated to id 1. 

    If the items are deleted then other item are not getting updated according to the IDs as I am dynamically adding a IDs in my collection.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard