How to Reset Check Boxes in a Power Apps Gallery?

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.

clear checkbox powerapps form submit

Here is the SharePoint list named “Virtual Workshop Registration Form.”

how to reset checkbox in gallery powerapps

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.

powerapps reset checkbox in gallery

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)
powerapps reset modern checkbox in form control

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
powerapps modern checkbox in gallery reset

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.

how to reset modern checkbox in gallery powerapps

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.

reset power apps checkboxes in gallery

2. Add the below variable in the Reset property of the checkbox control.

clear power apps checkboxes in gallery

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:

>