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:
and
Any explanation and help on why this is not working and how to fix it would be greatly appreciated.
This is way simple if you are inside the Gallery.
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
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)
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional