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

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
Super User
Super User

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

 

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

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 Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,036)