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 / Remove Item from Galle...
Power Apps
Answered

Remove Item from Gallery of Collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

I have a collection called 'collChallenges' and I have a gallery that displays the collection called 'ChallNewCollectionGallery'. I'm trying to give users a method of removing Challenges one at a time. I have tried two methods, neither of which is working properly. The trashcan method does sometimes allow for the removal of the first Challenge but no others. Here are screenshots of the two attempts:

rockmond_0-1595429316126.png

and

rockmond_1-1595429401992.png

Any explanation and help on why this is not working and how to fix it would be greatly appreciated.

 

 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    The problem may be related to the use of a collection as the Items property of the gallery.  The trashcan in the row will remove it from the collection but not the underlying datasource used to create the collection.  Unless the item is removed from the datasource, when a ClearCollect is done to refresh the gallery's collection, the item will reappear. If you want the item removed from the datasource and the collection you need to remove it and then refresh the collection, ie. for the OnSelect property of the trashcan icon

     

    Remove(ds,ID=ThisItem.ID); 
    ClearCollect(collection,ds)

     

    for the button outside the gallery:

    Remove(ds,ID=Gallery.Selected.ID); 
    ClearCollect(collection,ds)
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@rockmond,

    Based on the issue that you mentioned, do you want to remove the item from the gallery or the collection?

    The first formula you provided only remove the item from the gallery that won't remove item from the collection. If you want to remove a item from the gallery and the same to the collection, you should make sure to find the primary key in your data source.

    I tested the Remove() function seems that there is something wrong when working with the Gallery.Selected record. Please modify the formula as below

     

    Remove(collChallenges,LookUp(collChallenges,ID=ChallNewCollectionGallery.Selected.ID))

     

    Note: ID is a normal primary key in the data source, you can replace it with yours in the collChallenges.

    Best Regards,

    Qi

  • CALEBHOWARD80 Profile Picture
    27 on at

    This is way simple if you are inside the Gallery.

     

    Remove(DS,ThisItem

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard