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 / How to manage checkbox...
Power Apps
Unanswered

How to manage checkboxes individually and with a select/unselect all?

(0) ShareShare
ReportReport
Posted on by

Hey guys,

 

in my app I have a gallery with a checkbox in it, one for each row.

Before opening this thread https://powerusers.microsoft.com/t5/Building-Power-Apps/Select-all-Unselect-all-checkboxes-with-a-click-on-a-button/m-p/1654799#M421705 I was used to manage them easily one by one whit this set up:

 

Reset: varResetCheckbox

Default: ThisItem.Selezionato

OnSelect: UpdateContext({varResetCheckbox: true});;UpdateContext({varResetCheckbox: false})

OnCheck: Patch(collectionFlotta_Anag; ThisItem; {Selezionato: true})

OnUncheck: Patch(collectionFlotta_Anag; ThisItem; {Selezionato: false})

 

Now, applying the rules defined in the above link, I can easily manage the select/unselect all but I can't manage one by one cause the check element disappear once is the box is clicked

 

Can someone help me?

 

Tx

Categories:
  • theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    Hello,
    Please try putting as below:

     

    For Parent Checkbox(Heading row):
    OnCheck: UpdateContext({varResetCheckbox:true})
    OnUnCheck: UpdateContext({varResetCheckbox:false})

    Default: false

    Reset:false

     

    For Items Checkbox:

    Reset: false

    Default: varResetCheckbox

    OnSelect: false

    OnCheck: Patch(collectionFlotta_Anag; ThisItem; {Selezionato: true})

    OnUncheck: Patch(collectionFlotta_Anag; ThisItem; {Selezionato: false})

  • Sesese Profile Picture
    on at

    Which is the difference between Parent & Items checkbox?

  • theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    Whenever Parent checkbox is checked, All the items will be checked,

    and when Parent checkbox is Unchecked, All the items will be Unchecked,

    theapurva_0-1657111257470.png

     

    So use the setting as:

    For Parent Checkbox(Heading row):
    OnCheck: UpdateContext({varResetCheckbox:true})
    OnUnCheck: UpdateContext({varResetCheckbox:false})

    Default: false

    Reset:false

     

    For Items Checkbox:

    Reset: false

    Default: varResetCheckbox

    OnSelect: false

    OnCheck: Patch(collectionFlotta_Anag; ThisItem; {Selezionato: true})

    OnUncheck: Patch(collectionFlotta_Anag; ThisItem; {Selezionato: false})

  • Sesese Profile Picture
    on at

    This is my gallery actually:

     

    Diapositiva1.PNG

     

    In the checkbox I've put the rules in the first message.

    Then I've changed Default from ThisItem.Selezionato to varChecked and crated one button with UpdateContext({varChecked: true}) and another with UpdateContext({varChecked: false})

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Sesese ,

    You actually cannot have it both ways here entirely as you need the Default to show the current value in Selezionato, however if you put a "master" checkbox outside the gallery (I have called it ckMaster below), you can do a "Select All" which will work and when unchecked will revert to the value in the field. You do not need any resets here - use your existing code except the Default of the checkbox in the gallery can be

    ckMaster.Value || ThisItem.Selezionato

    You can also reduce your Patch code a bit - OnSelect (you do not need the OnCheck and OnUncheck) of the checkbox in the gallery

    Patch(
     collectionFlotta_Anag; 
     ThisItem; 
     Self.Value
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

     

     

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Sesese ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard