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 Apps
Answered

Collection

(0) ShareShare
ReportReport
Posted on by 150

I am using this formula for removing the items from the collection as well as from gallery and then updating the collection but this is not removing the items.

RemoveIf(colLocationinfoWithNumber,ID<=24);

Collect(colLocationinfoWithNumber,colLocationinfoWithNumber)

Categories:
I have the same question (0)
  • Bilakanti Profile Picture
    1,226 on at

    @Moira0509 - the code which you have written should work. can I know what is the issue that you're facing?

    Bilakanti_0-1674635549041.png

     

  • Moira0509 Profile Picture
    150 on at

    yeah it is removing the items from collection but why it is not updating.

    Moira0509_0-1674638706710.png

    I mean why remaining items id is not getting start from 1.

  • Bilakanti Profile Picture
    1,226 on at

    @Moira0509 I can see you are just removing the records <=24. No where the existing record ID's are been updated. If you want to start every time with 1, then every time you remove the records from collection, you need to even update all records ID value, then only it will work.

  • Moira0509 Profile Picture
    150 on at

    Even if I am using code like this it is not removing and updating

     

    RemoveIf(colLocationinfoWithNumber,ID<=24);
    Collect(colLocationinfoWithNumber,colLocationinfoWithNumber);
    ClearCollect(
    colLocationinfoWithNumber,
    ForAll(
    Sequence(CountRows(collocationinfo)),
    Patch(
    Index(
    collocationinfo,
    Value),{ID: Value})));

  • Verified answer
    Bilakanti Profile Picture
    1,226 on at

    @Moira0509  Use the below code this should work.

    RemoveIf(colLocationinfoWithNumber,ID<=24);
    Collect(colLocationinfoWithNumber,colLocationinfoWithNumber);
    ClearCollect(
    colLocationinfoWithNumber,
    ForAll(
    Sequence(CountRows(colLocationinfoWithNumber)),
    Patch(
    Index(
    colLocationinfoWithNumber,
    Value),{ID: Value})));

  • Moira0509 Profile Picture
    150 on at

    Yeah it work thanks

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard