Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Urgent - Select and deselect multiple checkboxes on toggle

Hi there,


I have a screen in my canvas app where I have a toggle to select-all checkboxes on that screen. 


OnVisible of the page, I have created the collection of allboxes using Collect(allboxes, 'checkbox1'.Value, 'checkbox2'.Value);   (I will add in the other 5 checkboxes once I've got this working).


What I want is, when the user turns the toggle to Yes, it ticks all the checkboxes which are in that collection. 


Please can someone help me out here?





Accepted Solutions

Hi @Kosenurm ,
I believe your checkboxes are independent. If I got you correctly, your set is something like the below screenshot.

on right side, I am trying to show the values reflected in coll_result based on my selection. 





Give a like and accept this as the solution if I answered you . 🙂 

View solution in original post


In the Onselect Property of the toggle you can apply ForAll for all the items in the collection and change their values

Super User
Super User

hi, create the collection in the following way

Collect(Col_Toggles,{value:Toggle1} etc.)


then change the toggle defaults to

Self in Col_Toggles && var_toggle


OnSelect of button change to all toggles

Set(var_toggle, !var_toggle)


Thanks, but this is for Check Boxes...


Which value of the checkbox control should I add to the collection?




take the default property of the checkbox

Super User
Super User

Hi @Kosenurm ,

I have a similar setup, but in a Lil different format as shown below screenshot. By selecting the checkbox on top, it selects all and, on deselect, it marks all as cleared.


Let's say your source is source1.

Step -1 :-
> On page load, ClearCollect(coll_GalDisplay,AddColumns(Source1,"ischecked",false)) this will create a collection "coll_GalDisplay" which we are going to use in gallery to display.
The new column added, ischecked will contain the value of checked Items.

> 2nd create a toggle/ separate check box (Marked in red in screen shot)
Property - OnCheck- Updateif(coll_GalDisplay,true,{ischecked: true})
Property - OnUncheck - Updateif(coll_GalDisplay,true,{ischecked: false})


For individual check boxes to select, or unselect, 


Property - OnCheck- Patch(coll_GalDisplay,,ThisItem,{ischecked:true})
Property - OnUncheck - Patch(coll_GalDisplay,,ThisItem,{ischecked:true})


Please give a like and accept this as the solution if this will help in your requirement.

Thanks. I think you are on the right path. 


What I need is...


When the user selects one of the checkboxes, this adds to a collection. If they add more than one, they are all added. If they uncheck one, or uncheck more than one, the collection is updated to their new check statuses. 


The toggle needs to set ALL checkboxes to checked OnCheck, and decheck ALL checkboxes OnUncheck...


Sorry, I am really struggling.




Super User
Super User

Could you please try On check property for an individual item,

Property - OnCheck- Patch(coll_GalDisplay,,ThisItem,{ischecked:true});
Collect(coll_result, ThisItem);

Property - OnUncheck - Patch(coll_GalDisplay,,ThisItem,{ischecked:true});
Remove(coll_result, ThisItem);


At the end, your collection "coll_result" will have the final list of items that you have selected for your next action.

I am not using a gallery, so ThisItem is not working.



If you are trying to collect it from a collection, I will suggest to add a button called "load".

So once you are clear with your selection, Click the load button to collect the selected values.


Load Button- Property "On Select"- ClearCollect(Coll_result,Filter(allboxes, ischeked = true)).

It will load all the items from allboxes collection to result collection where the condition satisfies.

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,373)