I have searched high and low and it doesnt seem that any of the solutions I found work. I have a gallery that's adding items to a collection using the checkbox integration. That part works fine. Once I unselect, it does not remove the item from the collection and I have tried all sorts of things. The only way I found to do it is to clear the entire collection with a button, however, it wont uncheck the already marked checkboxes if that is pushed.
Configuration:
Gallery "OnSelect" - Collect(Collection1, AvailableEquipment.Selected)
Checkbox "OnCheck" - Set(selectedDesk,ThisItem)
Checkbox "OnSelect" - Select(Parent)
Checkbox "OnUnCheck" - Set(selectedDesk,Blank())
The items I am choosing in the gallery have alot of columns. I saw some of the examples that allow you to only collect the columns you want which would also help remove the item as well. The barcode column would be a unique identifier to every line item.
Preferred Columns:
Item
Barcode
Solved! Go to Solution.
@Anonymous Also, Collect the item in collection on "OnCheck" action of checkbox and not "OnSelect" action of your gallery. Use below formula in "OnCheck" of checkbox:
Collect(Collection1, ThisItem)
OR
Collect(Collection1, AvailableEquipment.Selected)
@Anonymous , Try using below formula in "OnUnCheck" property of checkbox:
Remove(Collection1, LookUp(Collection1, BarCodeID = GalleryName.Selected.BarCodeID))
OR
Remove(Collection1, LookUp(Collection1, BarCodeID = ThisItem.BarCodeID))
Replace "GalleryName" and "BarCodeID" with your actual control and field names.
Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Unfortunately that didnt work. I used the Asset Tag field which is currently a unique identified for each line item. It adds but will not remove.
Remove(Collection1, LookUp(Collection1, 'Asset Tag' = ThisItem.'Asset Tag'))
@Anonymous Also, Collect the item in collection on "OnCheck" action of checkbox and not "OnSelect" action of your gallery. Use below formula in "OnCheck" of checkbox:
Collect(Collection1, ThisItem)
OR
Collect(Collection1, AvailableEquipment.Selected)
Finally! That fixed it! I tried a similar format before but guess I didnt get it right. Thank you!
Hi @Anonymous:
Do you want to use this checkbox control to add or delete records?
Please try this solution:
1\Empty this two property:
Gallery "OnSelect"
Checkbox "OnSelect"
2\Set these two property to:
Checkbox "OnCheck"
Collect(Collection1, ThisItem)
Checkbox "OnUnCheck"
Remove(Collection1, ThisItem)
Best Regards,
Bof
for me this line did not work
Remove(Collection1, LookUp(Collection1, BarCodeID = ThisItem.BarCodeID))
after a bit of playing around this worked
Remove(Collection1, LookUp(Collection1, BarCodeID = BarCodeID))
Thanks again for the answer!
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
50 | |
36 | |
35 |
User | Count |
---|---|
271 | |
91 | |
82 | |
76 | |
75 |