Power Apps Select All Checkbox in Gallery

In this Power Apps Tutorial, we will learn to select all checkbox control in a Power Apps gallery.

We recently received a request from one of our clients. They want to add a checkbox control called All within a Power Apps Gallery to meet their needs. When the ‘All‘ checkbox is selected, all of the other checkboxes in the gallery are automatically selected.

Power Apps Select All Checkbox In Gallery
Power Apps Select All Checkbox In Gallery

Also, Read: Power Automate Dataverse Add New Row

Power Apps Select All Checkbox In Gallery

To work with this scenario, follow the below step-by-step guide.

  • We have a SharePoint list based on the ‘Job Registration List’ having different types of fields such as single lines of text columns, choice columns, number columns, etc.
Select All checkbox in a Power Apps gallery
Select All checkbox in a Power Apps gallery
  • On the Power Apps screen, add a Power Apps edit form and connect that edit form to the SharePoint list.
Select All checkbox in a PowerApps gallery
Select All checkbox in a PowerApps gallery
  • On the Job Location data card, we can find a combo box control for selecting the location options.
  • Inside that job location data card, remove the combo box control and add a vertical gallery. Insert the below expression on the gallery’s Items property.
Items = Choices('Job Registration List'.'Job Location')
How to Select All checkbox in a Power Apps gallery
How to Select All checkbox in a Power Apps gallery
  • Add a checkbox control to the above gallery and insert the below expression on the Text property of the checkbox control. As a result, the gallery will display all the choices as shown below:
Text = ThisItem.Value
Power Appa Select all checkbox outside gallery to select checkbox inside gallery
Power Appa Select all checkbox outside gallery to select checkbox inside gallery
  • Add another checkbox control outside of the gallery and place that control inside the gallery (under the Scotland option). Rename the checkbox control as All.
Power Apps Select all checkbox outside gallery to select checkboxes inside gallery
Power Apps Select all checkbox outside gallery to select checkboxes inside gallery
  • Insert the below expression on the All checkbox’s OnCheck property.
OnCheck = Set(varCheckAll,true);

Where varCheckAll is the name of the global variable and true is the value of the variable.

select all checkbox in gallery power apps
select all checkbox in gallery power apps
  • Similarly, insert the below expression on the All checkbox’s OnUncheck property.
OnUncheck = Set(varCheckAll,false);
Power Apps Select All Checkbox In a Gallery
Power Apps Select All Checkbox In a Gallery
  • Finally, update the global variable name in the Gallery’s checkbox control’s Default property.
Default = If(
    IsBlank(varCheckAll),
    ThisItem.Value,
    varCheckAll
)
select all checkbox in gallery PowerApps
select all checkbox in gallery PowerApps

That’s it! Save and preview the app for now. We can see that when we click on the All checkbox, all the rest checkbox controls will be checked automatically within the gallery as shown below:

Power Apps select All checkbox in gallery
Power Apps select All checkbox in gallery

This is how to select all checkbox in the gallery Power Apps.

Additionally, you may like some more Power Apps tutorials:

Conclusion

From this above Power Apps tutorial, we learned how to select the ‘All’ checkbox in the gallery to check the rest checkboxes automatically within the Power

>