Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Reset a checkbox in a gallery

(0) ShareShare
ReportReport
Posted on by

I have a gallery includes one field and it is a checkbox showing the options from a SharePoint choice column. I do not have a form on my screen. When a button is clicked on the screen, a call is made to a powerautomate flow to upload the document to a document library and then reset the fields on the screen. The reset works fine for all fields EXCEPT for the gallery that contains the one checkbox. How can I get the checkbox field to reset?

Categories:
  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Reset a checkbox in a gallery

    @AnnetteM 

    Happy to help!

  • AnnetteM Profile Picture
    AnnetteM on at
    Re: Reset a checkbox in a gallery

    You are correct. There was no need for that to be in the default field. I removed it and it is working as expected. Thanks for all your help!

  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Reset a checkbox in a gallery

    @AnnetteM 

    How are you setting that?  It is going to reflect whatever value in in that record when you reset.  So if ThisItem.Value is true, then a reset will reset your checkbox to "checked", if it is false, then it will reset it to unchecked.

  • AnnetteM Profile Picture
    AnnetteM on at
    Re: Reset a checkbox in a gallery

    I have the default property of the checkbox as the value in the collection: ThisItem.Value in colDocType.Value, which helps ensure that I have the correct items to pass to the powerapp. Do I need to change this?

  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Reset a checkbox in a gallery

    @AnnetteM 

    Keep in mind that resetting ANY control in PowerApps will reset it back to the Default properties.  So, resetting a checkbox does not mean make it "unchecked", it means reset to the Default property value.

     

    For example, if your default was set to "true", then when the control resets, it will reset to being checked.  If the default is set to false, then the control will reset to unchecked.

     

    All that said...what is your default property on the checkbox?

  • AnnetteM Profile Picture
    AnnetteM on at
    Re: Reset a checkbox in a gallery

    I tried that. My screen has a gallery on it and within the gallery it has one item and that is a checkbox. The button that kicks off the flow and do other things, has the two update context within it referencing "resetInputField" which is the same language attached to the check box's Reset property. The other fields on the screen are reset, but the gallery and the checked items still retain the check. I must be missing something.

  • Verified answer
    RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Reset a checkbox in a gallery

    @AnnetteM 

    Add the following after your flow is completed:

    UpdateContext({lclReset: true}); UpdateContext({lclReset: false})

     

    Then set the Reset property of your Checkbox to: lclReset

     

    I hope this is helpful for you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard