Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to check or uncheck a checkbox in a gallery without appending to a variable



Can I am new to power apps and have been stuck on this. Can someone help please.


I have a gallery with 4 checkboxes in it.  I need to email those that are selected.

This is what I have but not sure hwo to fix it.


1) OnCheck I have 

Set(ItemsSelected, Concatenate(ItemsSelected, ThisItem.'Task Name'))

Q1) every time the form is submitted, it seems that ItemsSelected Variable grows. I tried to use reset and it did not work.

Q2) if user decideds to uncheck a checkox, how do I remove from from my variable?


Any pointer is greatly appreciated.







Accepted Solutions
Not applicable

Thank you all for taking the time to respond to my question.

View solution in original post

Skilled Sharer
Skilled Sharer

Will you please send a screen shot of your gallery?


Have you considered a collection for the items that are checked within the gallery.  Upon Submit, you can clear the collection.  If you uncheck an item, you can easily remove it from the collection.

Not applicable

Thanks for replying.  Yes, I tried to use collection, however my chackboxes are in a gallery and I I need a 
forAll and Filter to select only those checkboxes that are selected. No matter how I did it,  I could not get the correct syntax for 

ForAll (Filter(Collection name)) 

that is basically what the issues is. 


I definced a global variable and appended all those checkboxes that were selected , however If a user uncheck one, I can't drop it (not a good approach)

I tried to use a collection, and if 3 items are selected, only one of them shows up in the collection. 
how do you do ForAll and select only those that are checked so my the collection should get 3 rows in case 3 checkboxes are selected. I can't use item1, item2 ... since ony one checkbox name is available.

Thanks again



As @KickingApps has mentioned, best is to use a collection.

I have an app that does something similar and this is my syntax for the "For All":


ForAll(Filter(galClientList.AllItems,chkSelectRecord.Value = true),Collect(colSelectedItems,{ID:Value(lblID.Text)}));



- galClientList is the name of the gallery

- chkSelectRecord is the name of the checkbox

- colSelectedItems is the name of the collection


I am holding the IDs in the collections


Solution Sage
Solution Sage

Hello Gulf_Man,

You also add a label (you don't need the label but it a way to display the result)
Label1.Text= Concat(Gallery1.AllItems,If(Checkbox1.Value,'Task Name'))

Instead of Gallery1 and Checkbox1, you need to use the names of your Gallery and Checkbox

Not applicable

Thanks for your instructions. I will give it a try and le you know in a couple of days.. Greatly appreciated.

Community Support
Community Support

Hi @Anonymous ,

Based on the formula that you provided, I think the global variable could achieve your needs.


As an alternative solution, you could consider take a try to initialize a Collection to collect the Task Name when the corresponding CheckBox is checked.

I have made a test on my side, please take a try with the following workaround:

Set the OnCheck property of the Checkbox to following:

Collect(ItemsSelected, ThisItem.'Task Name')

Set the OnUncheck property of the Checkbox to following:

Remove(ItemsSelected, LookUp(ItemsSelected, Value = ThisItem.'Task Name'))


If you want to use ForAll function to collect those checkboxes that are selected, I have made a test on my side, please take a try with the following workaround:

         Filter(Gallery_M.AllItems, Checkbox1.Value = true),
                    'Task Name'


If you want to display the selected Task Name within a Label control, please set the Text property of the Label to following:

Concat(ItemsSelected, Value & "; ")

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not applicable

Thank you all for taking the time to respond to my question.

View solution in original post

Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (5,107)