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 items from coll...
Power Apps
Answered

Remove items from collection with checkbox

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

Categories:
  • ganeshsanap Profile Picture
    1,555 on at

    @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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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'))

  • Verified answer
    ganeshsanap Profile Picture
    1,555 on at

    @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)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Finally! That fixed it! I tried a similar format before but guess I didnt get it right. Thank you!

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    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

  • iselghaz-mstf Profile Picture
    Microsoft Employee on at

    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!

  • ElvinV Profile Picture
    31 on at

    If I have 1 check box selected how can I delete the other check box without having to click uncheck? I am using a gallery check box as filter

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 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard