cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
evalindag
Helper III
Helper III

Reset all checkboxes in Gallery Collection

Hi there,

I am building an app in which many checkboxes can be checked to make an booking. The checkboxes are inside a gallery which is also a collection. 

I want to add an button / icon which resets all the chosen checkboxes and I also want the checkboxes to reset when I navigate from the screen to another screen.

I've tried some recommendations I have found on the forum however none of them seem to work

 

Can anybody help me with this problem?

 

Best regards

Eva

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @evalindag ,

Do you want to reset all Checkbox within your Gallery when you press the "Reset" button or navigate to another screen?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:

8.JPG

 

9.JPG

Set the OnSelect property of the "Reset" button to following:

Set(IsReset, false);Set(IsReset, true)

Set the Reset property of the Checkbox within the Gallery to following:

IsReset

 

Set the OnHidden property of current Screen (which contains the Gallery) to following:

Set(IsReset, false);Set(IsReset, true)    // Reset Checkbox when you navigate to another screen

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @evalindag ,

Based on the screenshot that you mentioned, I think this issue is related to the Default property of the Checkbox. Please remove the formula within the Default property of the Checkbox control.

 

If you set the Default property of the Checkbox to ThisItem.IsChosen formula, when you press the "Reset" button, it would reset the Checkbox to default value (ThisItem.IsChosen) rather than uncheck the Checkbox.

 

If you bind the Default property of the Checkbox to the IsChosen column in your collection, the Reset functionality would not work, because, the Checkbox would be check or unchecked based on the IsChosen column value in your collection.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

13 REPLIES 13
eka24
Community Champion
Community Champion

Follow these:

1. OnVisible of the Screen use this:
     UpdateContext({ResetCheckbox:false})

 

2. Put ResetCheckbox on each of the Reset of your checkboxes

 

3. Insert a button and OnSelect put: UpdateContext({ResetCheckbox:true})

Thus anytime you click on the button, the checkboxes woul be cleared

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

Hi @eka24  and thank you very much for your reply

 

I have tried implementing your solution into my app, however nothing happens when I push the button 😕 

My checkboxes are used to patch into a collection, could that be the reason for this not working? 

 

Regards

 

eka24
Community Champion
Community Champion

After creating the Variable, go to another screen before it takes effect.

If it does not work please give a screen shot. I have tried it.

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

I tried it, no luck.

 

I've also tried refreshing the app and opening and closing it, that doesn't work either.

 

The screenshot didn't post with the message, here they are 🙂 

2020-04-07_13-37-15.png2020-04-07_13-37-29.png2020-04-07_13-37-35.png

eka24
Community Champion
Community Champion

Everything you have done is OK.

Did you click the button with the UpdateContext formula and it did not clear? Please not the Push or submit button.

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

v-xida-msft
Community Support
Community Support

Hi @evalindag ,

Do you want to reset all Checkbox within your Gallery when you press the "Reset" button or navigate to another screen?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:

8.JPG

 

9.JPG

Set the OnSelect property of the "Reset" button to following:

Set(IsReset, false);Set(IsReset, true)

Set the Reset property of the Checkbox within the Gallery to following:

IsReset

 

Set the OnHidden property of current Screen (which contains the Gallery) to following:

Set(IsReset, false);Set(IsReset, true)    // Reset Checkbox when you navigate to another screen

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft and thank you very much for your reply

However, I get the same problem when trying your solution, nothing happens when I push the button.

I took a screenshot of the advanced setting for my checkbox, as you can see I use "on check" and "on uncheck" to patch into a collection. Could that be the issue? 

 

Hi @evalindag ,

Based on the screenshot that you mentioned, I think this issue is related to the Default property of the Checkbox. Please remove the formula within the Default property of the Checkbox control.

 

If you set the Default property of the Checkbox to ThisItem.IsChosen formula, when you press the "Reset" button, it would reset the Checkbox to default value (ThisItem.IsChosen) rather than uncheck the Checkbox.

 

If you bind the Default property of the Checkbox to the IsChosen column in your collection, the Reset functionality would not work, because, the Checkbox would be check or unchecked based on the IsChosen column value in your collection.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,699)