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 / Urgent - Select and de...
Power Apps
Answered

Urgent - Select and deselect multiple checkboxes on toggle

(0) ShareShare
ReportReport
Posted on by 802

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?

 

Thanks, 

K. 

Categories:
I have the same question (0)
  • Tushya_Trivedi Profile Picture
    52 on at

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

  • C-Papa Profile Picture
    1,836 on at

    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)

     

  • Kosenurm Profile Picture
    802 on at

    Thanks, but this is for Check Boxes...

     

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

  • Tushya_Trivedi Profile Picture
    52 on at

    Tushya_Trivedi_0-1643033050679.png

    Tushya_Trivedi_1-1643033067808.png

     

    take the default property of the checkbox

  • Abhilash_Swain Profile Picture
    901 on at

    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.

    Abhilash_Swain_1-1643032192389.png

    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, 

    Abhilash_Swain_2-1643032868296.png

    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.

  • Kosenurm Profile Picture
    802 on at

    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.

     

    Thanks

    K.

  • Abhilash_Swain Profile Picture
    901 on at

    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.

  • Kosenurm Profile Picture
    802 on at

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

     

    K.

  • Abhilash_Swain Profile Picture
    901 on at

    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.

  • Kosenurm Profile Picture
    802 on at

    Thanks. Where are you setting the IsChecked value from?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard