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.
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.
- On the Power Apps screen, add a Power Apps edit form and connect that edit form to the SharePoint list.
- 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')
- 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
- 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.
- 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.
- Similarly, insert the below expression on the All checkbox’s OnUncheck property.
OnUncheck = Set(varCheckAll,false);
- Finally, update the global variable name in the Gallery’s checkbox control’s Default property.
Default = If( IsBlank(varCheckAll), ThisItem.Value, varCheckAll )
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:
This is how to select all checkbox in the gallery Power Apps.
Additionally, you may like some more Power Apps tutorials:
- Power BI Group by Column [With Various Examples]
- How to Get Dataverse Created by in Power Automate
- How to Patch Dataverse Number Field in Power Apps
- Dataverse Power BI [Complete tutorial]
- How to Get Gallery Item By ID in Power Apps
- Power Apps Set ThisItem Value [With Real Examples]
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
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com