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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard