web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Resetting a Checkbox c...
Power Apps
Answered

Resetting a Checkbox control to it's original state if user selects Cancel

(0) ShareShare
ReportReport
Posted on by 14

Hi,

 

I have a gallery which contains a checkbox control, which defaults to a value in a collection. The user can check/uncheck the box and hit 'Save' to parse the changes to the collection. Note: The gallery is hidden until the user hits a 'Settings' button.

 

Screenshot 2023-05-09 at 12.40.16.png

The issue is that if the user changes the box from Checked to Unchecked the box (or vice-versa) and selects 'Cancel' or 'Close', it remembers the last state of the checkbox, regardless of what the collection value is. Selecting 'Cancel' or 'Close" simply sets the gallery to hidden.

 

I would like to reset the gallery checkboxes to their original state but not sure how. Any help would be grateful received.

 

Thanks,

Lee

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @eleet74,

     

    You can achieve this by resetting the checkboxes via a variable. In the Cancel/Close button's OnSelect, add the following code:

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

     

    The Reset property of your checkbox (within the gallery) should be:

    varReset

     

    When clicking 'Cancel', the checkboxes should now default back to the collection's values.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • eleet74 Profile Picture
    14 on at

    Thank you. Works perfectly. 👍

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard