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 check/uncheck a...
Power Apps
Unanswered

How to check/uncheck all checkboxes in a gallery?

(0) ShareShare
ReportReport
Posted on by 65

Hello,

I'm developing my first Canvas App with datasource in a Sharepoint List, which is represented in a gallery. This gallery shows a checkbox "Member" and textfield "Name" per line, with checkbox Default = ThisItem.Member. So, this works fine because the gallery shows me the content of the Sharepoint list.

Now I have also a separate checkbox above the gallery and with this checkbox I want to check or uncheck ALL checkboxes in the gallery - BUT in a way so that I still can check/uncheck each individual checkbox in the gallery. So, the extra checkbox should work as a "check/uncheck" all function.

I have tried many different actions with ForAll, Patch and UpdateIf, but each of them had errors and so did not work.

See below picture for my design with the checkboxes:

 

Knipsel.PNG

 

Can you please help me and give a suggestion how to implement this functionality?

Many thanks in advance!

Categories:
  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @PimJ 

     

    Consider the following:

    You have two modes, for one mode you want the SharePoint value and the other the value from your other checkbox.  To activate the mode lets add a local variable and call it _ActAll. Leys set the variable to true when you want to act on all the checkboxes. When the app opens the default mode must be the second mode as the checkbox must show the member column. Lets do this:

    1. The checkbox (chkBoxActOnAll) which needs to check/uncheck all OnSelect property,  = UpdateContext({_ActAll:true})
    2. The Checkbox (chkMember) Default property changes to If(_ActAll, chkBoxActOnAll.Value, ThisItem.member)

    Thats it, you can add another button to reset the checkboxes to their original state as well (i will leave that to you to figure out 😉 )

     

    Here we go lets see what it looks like:

    Step 1

    rubin_boer_0-1702132400663.png

     

    Step 2

    rubin_boer_1-1702132430388.png

     

    Result

    CheckAllPApp.gif

  • PimJ Profile Picture
    65 on at

    Hello rubin_boer, thanks for your quick reply and help!

    This really works nice as I can change the individual checkboxes.

    I didn't know that it was that easy 😉

     

    I have one other question related to this:

    Do you also know how I can force the gallery to reload/refresh the original data from the connected datasource,  after I made the checkbox-changes - which is the SP-list? Or should I then "rebuild" the whole gallery?

    Thanks, Pim

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hey there @PimJ after you patch your data source the gallery will be updated with the latest data from SP. add the following code after you have patched your SharePoint list UpdateContext({_ActAll:false}), this will have the SP list member value be displayed and not the state of the check/uncheck checkbox (i take it this is the issue you are experiencing?). 

     

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard