Custom Multi-Select Checkbox with Gallery in Power Apps Forms
Learn to replace the standard combo box with a gallery‑based checklist that stores multiple selections correctly in SharePoint.
In many business applications, users need to pick more than one value from a set of options. While Power Apps offers the combo box for multiple selections, sometimes a checklist-style interface is more intuitive or required by design. This article walks through building a custom multi-select checkbox control by combining a gallery with individual checkboxes, and correctly saving the selections back to a SharePoint list.
Our example scenario is a Task Assignment Manager – a project management tool where each task can require multiple competencies (Design, Development, Testing, DevOps). The SharePoint list ProjectTasks stores these competencies in a multi‑select choice column.
Creating the SharePoint List
Create a new SharePoint list named ProjectTasks and add the following columns:
- Title (single line of text)
- Due Date (date)
- Estimated Hours (number)
- Competencies Required (choice, with Allow multiple selections enabled)
Add four choice values: Design, Development, Testing, and DevOps. Populate the list with a few sample rows so you have data to work with.
Setting Up the App Canvas
Open Power Apps Studio and create a canvas app from blank. Insert a data source connected to the ProjectTasks list, then add an Edit form. Configure the form’s DataSource and set its DefaultMode to FormMode.New.
The form automatically exposes all four columns. Locate the Competencies Required card – it shows a Combo box control by default. Delete that combo box and expand the card’s height to leave room for a gallery.
Building the Multi‑Select Checkbox Gallery
Inside the Competencies Required card (not inside the gallery), insert a Blank vertical gallery. Write the following code in its Items property to pull the list of all possible options:
Choices('ProjectTasks'.'Competencies Required')Now add a Checkbox control (from the Input menu) inside the gallery. Set its Text property to:
ThisItem.Value
Resize the gallery so all checkboxes fit inside the card.
Tracking Selections with a Collection
Select the checkbox inside the gallery. Use its OnCheck and OnUnCheck properties to manage a collection named colSelectedCompetencies.
OnCheck – add the selected value to the collection:
Collect(colSelectedCompetencies, ThisItem.Value)
OnUnCheck – remove the unchecked value:
RemoveIf(colSelectedCompetencies, Value = ThisItem.Value)
Because the gallery contains only one checkbox template, these formulas apply to every row dynamically.
Connecting the Checkbox Selections to SharePoint
The Update property of the card determines what data is written to SharePoint when the form is submitted. Select the Competencies Required card (the entire card, not the gallery) and set its Update property to:
colSelectedCompetencies
Any error shown on the card will now disappear. You can optionally delete the ErrorMessage label inside the card; it is not needed for this pattern.
Submitting the Form
Place a Button below the form and set its OnSelect to:
SubmitForm(Form_NewTask)
To keep the form in a clean state after submission, store the last submitted record and switch to view mode. Use the form’s OnSuccess property:
Set(varCurrentTask, Form_NewTask.LastSubmit); ViewForm(Form_NewTask);
Then set the form’s Item property to varCurrentTask so it displays the submitted record in read‑only mode.
Loading Existing Selections Back into the Checkboxes
When an existing record is opened for editing, the checkboxes must reflect the values already stored. Create a browse screen with a gallery connected to the ProjectTasks list. Write the following code in the OnSelect of that gallery (or a navigation button) to load the record and populate the collection:
Set(varCurrentTask, ThisItem);
ClearCollect(colSelectedCompetencies, varCurrentTask.'Competencies Required');
EditForm(Form_NewTask);
Navigate('Edit Task Form');Now return to the checkbox inside the edit form’s gallery. Set its Default property to the following expression – this tells each checkbox whether it should appear checked:
ThisItem.Value in colSelectedCompetencies.Value
Test the flow: navigate from the browse screen to an existing record; the correct checkboxes are already selected.
Performance and Delegation Notes
The Choices function returns at most 2000 options, which is more than enough for typical choice columns. The collection and gallery logic run entirely on the client, so there is no delegation bottleneck. For very large choice lists (seldom needed), consider limiting the number of options or using a different data source.
Common Mistakes to Avoid
- Forgetting to clear the collection before loading existing values. Always use
ClearCollectinstead ofCollectwhen populating from an existing record to avoid duplicate entries. - Omitting the card’s
Updateproperty. Without this, the form will not pass the selected values to SharePoint, and the data will be lost. - Using the wrong
Defaultsyntax. The expressionThisItem.Value in colSelectedCompetencies.Valuemust be written exactly this way – note the.Valueon both sides.
Final Recommendation
The multi‑select checkbox gallery gives you full control over the appearance and behavior of your form’s choice fields. It is ideal when you need a checkmark‑style picker, particularly in forms that already use galleries or require inline selection. For straightforward single‑selection needs the combo box remains a fine choice, but whenever you want a clear, user‑friendly multi‑pick interface without leaving the gallery pattern, this approach is both flexible and reliable.
References
- Original inspiration: Matthew Devaney, Power Apps Multiple Selection Checkbox
- Microsoft Learn: Choices function
- Microsoft Learn: Collect and ClearCollect functions
Learn how small coding practices—like using descriptive names, flattening conditions, and simplifying logic—can make your apps easier to update and less error-prone.
Move past the gallery and discover the hidden patterns for validation, navigation, and smart submission handling in your data entry forms.
PowerShell unlocks admin capabilities that the Power Platform admin center simply doesn’t offer—from recovering deleted apps to blocking trial licenses. Here’s how to wield them safely.