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 / Checkboxes in gallery ...
Power Apps
Answered

Checkboxes in gallery not resetting when a new form is created

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have Checkboxes nested in a gallery which are not resetting when a new form is created (values from previous submission remain).

 

The settings for the datacard in which the gallery is nested are:

 

Default: ColCategoryData

Update: ColCategoryData

 

This is the collection created and modified by clicking the Check button.

 

Check button properties:

Oncheck: Collect(ColCategoryData,ThisItem);

Onuncheck: Remove(ColCategoryData,ThisItem);

 

In order to reset the check boxes I have put in the following formula for the "onvisible" property for the screen containing the new form:

 

Clear(ColCategoryData);

 

But it's not clearing the checkboxes. What have I done wrong?

 

Thanks a lot!

 

Regards,

 

Dan

Categories:
I have the same question (0)
  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Your checkbox isn't actually using any data from the collection, so clearing the collection won't cause it to reset.

     

    Here is how to fix that.   On App start set a variable to false and add the variable in the Reset attribute of the checkbox.

     

    Reset: varXXX

     

    In your onVisible of the screen do this:   Set(varXXX, true); Set(varXXX, false)

     

    It's important that you do both commands.  The reset attribute requires a true/false value.    The value only needs to be true long enough for the control to reset and then should be false

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @JR-BejeweledOne ,

     

    You are a genuis. It worked like a bomb!

     

    Thank you Thank you!

     

    Regards,

     

    Daniel

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @JR-BejeweledOne ,

     

    I'm using the same form in edit mode to edit the item as when it's in new mode to capture a new item. Now when I create a new item and go to view it in view mode and also try to edit the form in edit mode, the check boxes retained their checks which is good, however if I go create a new item after that the check boxes are blank which is great but when I go back to my gallery and open the previously created item, the value is still correct in view mode but when I open the item to edit it, the check box has been changed to the value of the record I captured after this one? 

     

    How do I get the check box to retain it's value in edit mode if I'm using the same form for both creating new items and editing prior ones?

     

    Thanks a lot!

     

    Daniel 

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    What is the default property for your checkboxes on the form?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @JR-BejeweledOne ,

     

    It's false.

     

    Regards,

     

    Dan

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Try setting it to Parent.Default

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @JR-BejeweledOne ,

     

    Still not winning:

     

    DanielRK_0-1615215024023.png

     

    DanielRK_1-1615215051482.png

     

    DanielRK_2-1615215069978.png

     

    Sorry to trouble you. Thanks for your help on this.

     

    Regards,

     

    Daniel

     

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    What is your forms Items property set to?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @JR-BejeweledOne

     

    Choices([@'CRM Surveys'].AccountQueries)

     

    Thanks again.

     

    Regards,

     

    Dan

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Is this a multi-select from your data source by any chance?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard