Introduction
In this article, we will learn PowerApps edit form customization. We will specifically customize multi-select combobox and use multi-select checkbox instead.
Usecase
As you know if a column in SharePoint list with type choice, PowerApps by default use combobox as datacard, but sometime we required multi-select checkbox to be used instead of it.
Prerequisite
Sharepoint list with a choice column with multi-select.
Steps
- First and basic step is to create new PowerApps
- Add datasource as SharePoint list that we have just created
Add edit form in screen and set datasource as SharePoint List
Click on edit field of edit form and add SharePoint column with choice type. In this case, I have added topic column.
Remove default comboobx control and add verticlal gallery in edit form datacard and add checkbox within the gallery, when you remove default datacard then you will find some errors but don't worry set below properties which solve the errors.
Control Name |
Property |
Value |
ErrorMessage2 |
Y |
Gallery1_1.Y + Gallery1_1.Height |
Gallery1_1 |
Items |
Choices([@PowerAppsEditFormCustomization].Topics) |
Checkbox2_1 |
Text |
ThisItem.Value |
Checkbox2_1 |
Default |
If(CountRows(Filter(SelectedTopics,Value=ThisItem.Value))>0,true,false) |
Checkbox2_1 |
OnCheck |
Collect(SelectedTopics,ThisItem.Value) |
Checkbox2_1 |
OnUncheck |
RemoveIf(
SelectedTopics,
Value = ThisItem.Value
) |
Save the app, and you have now replaced multi-select combobox control with multi-select checkbox.
NOTE
I have also attached exported PowerApps so you can download and import it. This may help you to use the code. I have removed sharepoint datasource before export so you need to add it after import with choice column in list.