While working on a Power Apps form, I was required to convert the SharePoint list choice column values into checkboxes in the form so that users could select multiple options.
After submitting the data, the form needs to be reset, but the checkboxes do not reset whatever the user selects; they will be present by default whenever the user opens the form.
In this article, I will explain how to use checkbox control for SharePoint list choice values and reset the checkboxes within the gallery in the Power Apps form.
Create Multi-Select Checkboxes in Power Apps for SharePoint List Forms
In the example below, I have a Power Apps “Virtual Workshop Registration Form.” Within the form, I took a check box control within a gallery to display the “I’d like to learn about following” field choice values.
After submitting the form, the fields are reset along with checkboxes.
Here is the SharePoint list named “Virtual Workshop Registration Form.”
To reset the checkbox in the gallery where the gallery is within the Power Apps form. Follow the below steps.
1. In Power Apps, add an Edit Form and connect it with the above SharePoint list.
2. Add a Blank Vertical Gallery within the Power Apps forms, “I’d like to learn about the following Data card.” Then, provide the formula below for the items property of the gallery.
Choices([@'Virtual Workshop Registration Form'].Idliketolearnaboutfollowing)
3. Add a checkbox control within the Power Apps gallery in the form control. Then, add the formula below to its Text property.
ThisItem.Value
4. Provide the formula below in the OnCheck property of the check box control within the Power Apps gallery.
Set(
varLanguangeNames,
ShowColumns(
Filter(
Gal_Options.AllItems,
Checkbox.Value
),
Value
)
)
This varLanguangeNames variable stores the selected options in the gallery.
5. Provide the same formula in the OnUncheck property of the check box control in the Power Apps gallery.
6. Add the below formula in the Update property of the DataCard.
Coalesce(varLanguangeNames,ThisItem.'I''d like to learn about following')
Here, the coalesce () function takes the nonnull values first when selecting all items in the gallery.
Reset Check Boxes in a Power Apps Gallery
1. Add the formula below in the OnSelect property of the save button.
SubmitForm(Frm_Workshop);
NewForm(Frm_Workshop);
UpdateContext({ResetCheckbox:true});
UpdateContext({ResetCheckbox:false});
Here, the SubmitForm() function will submit the data to the SharePoint list, and the NewForm() function will make the form new after submitting the data.
To reset the checkboxes in the gallery, I created a local variable called ResetCheckbox that holds the toggle value.
2. Add the below variable in the Reset property of the checkbox control.
3. Save the changes and preview the app once. After submitting the form, the checkboxes within the gallery also reset.
This way, we can reset the check box controls within the Power Apps gallery in the form.
I hope you understand how to create multi-select checkboxes in Power Apps for SharePoint list forms and reset the checkboxes in the gallery.
You can follow this article while trying to create multi-select checkboxes for SharePoint list choice values and reset the checkboxes.
Also, you may like:
- Power Apps Uncheck Checkbox When Another is Checked
- Power Apps filter gallery by dropdown
- Display the Power Apps collection on gallery
- Filter Power Apps gallery by current user
- Power App’s modern checkbox control
- Create Power Apps Repeating Table With New Form
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