cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
victore
Level: Powered On

How do I uncheck a checkbox that is inside a gallery?

Scenario:  I put a checkbox in a gallery. That means that all the items are going to have a checkbox.  I want to uncheck(or reset) all the checkboxes(or the checkbox) when the screen first shows up or when I click the X icon in the NavBar.  Is this possible? 

I have tried a couple of things to uncheck(reset) a checkbox if the checkbox is in a gallery and the user leaves that screen by either clicking on the X icon. 

 

First, I created a global variable on the OnStart and/or OnVisible of the landing screen property and set it to false like so Set(chkbxcval, false).  On the Default property of the checkbox I put this variable. (Doesn't work). 

I have also put it on the OnSelect property of the X icon that is in the Navbar of the screen where the Gallery that contains the checkbox is.

 

Second, I have typed chkb_SelectedAttachment.Value=false on the screen where I have the gallery that contains the checkbox and nothing and I have tried other things as well.  Anybody knows if resetting or unchecking is possible for a checkbox inside a gallery?

 

Please heee..lp!

1 ACCEPTED SOLUTION

Accepted Solutions
victore
Level: Powered On

Re: How do I uncheck a checkbox that is inside a gallery?

Maybe I did not implement your solution correctly, but your solution did not help me.  Nonetheless, thanks a million for giving support, I greatly appreciate it. I did find the one that helped me here:
https://powerusers.microsoft.com/t5/General-Discussion/Reset-Checkboxes-in-Gallery/m-p/131424#M45741

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: How do I uncheck a checkbox that is inside a gallery?

 

Hi @victore,

 

I just tested and this actually works for me:

1. Set the OnVisible property of the first screen to:

UpdateContext({Var:true})

2. Set the Reset property of the check box to:

 

 

Var

 

 

The no matter if last time you have checked any of these check boxes, next time you reopen this app, all check boxes will reset to false.

 

Of course, the boxes won't reset if you navigate to the next screen and then get back. If you also want to achieve this way, you just need to add below formula next to your Back() or Navigate(BrowseScreen1, ScreenTransition.None):

 

Back();UpdateContext({Var:true})

 

And with the button, just set its OnSelect property to:

 

UpdateContext({Var:true})

 

 

Regards,

Mona

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
victore
Level: Powered On

Re: How do I uncheck a checkbox that is inside a gallery?

 

 I have 5 screens. One for the List items, the EditScreen, the detail item, the send email screen and the Fifth Screen which is where I have the attachments for the selected item list. It is in the Fifth screen where I have the checkbox inside the gallery.

The first Screen would be the Item gallery screen. If I follow your advice I would have to type Navigate(DetailScreen1, ScreenTransition.None,{CV:Var}) on Nav icon in the OnSelect property so I can push the value to the next screen, otherwise, when I go to the Attachment screen it is not going to recognize the Var context variable. I think it should be a Global variable because I would have to pass the context variable across a couple of screens, which I did. Here is my issue. As you can see the Fifth Screen has an X icon button in the nav bar. If the user decides not to attach any of this attachments but have selected several attachments, he/she would only have to close the screen, so the user does not have to uncheck any of the checkboxes. I have in the X icon the following formula: Navigate(SendEmailScreen,ScreenTransition.Cover,{RCB:true}) where RCB is the Context variable that I have been dragging from the First screen (That is why I was using a global variable instead). Nonetheless, I go back all the way to the first screen and decide to click on the same item, the checkboxes I selected and then decided not to send they are still selected when I click on the Select Attachment button.

In other words, if I click on the X icon on the Nav bar of the Fifth Screen it would take me to the SendEmailScreen. If I also click on the X icon of the Nav bar of the SendEmail Screen it is going to take me to the First Screen(Browse Screen). Here is where I have set the Context variable Var to True, so in theory, if I click on the Detail screen which is the Second Screen and from there I hit the button Select Attachment I shouldn't see any checkbox selected on the fifth screen, Right? But that is not is what is happening.
 
 
 I found out that even without putting the variable to true on the Reset property of the Checkbox, if I select another item and then I go back to the item where the attachments were selected, the selected checkboxes are cleared or uncheck. I think there is a bug when putting a checkbox inside the gallery, but putting the Reset property equal to a variable with the value of true is just not working for me.  Help!!!!!!!!!!!!!!!!!!!
 
 
victore
Level: Powered On

Re: How do I uncheck a checkbox that is inside a gallery?

Maybe I did not implement your solution correctly, but your solution did not help me.  Nonetheless, thanks a million for giving support, I greatly appreciate it. I did find the one that helped me here:
https://powerusers.microsoft.com/t5/General-Discussion/Reset-Checkboxes-in-Gallery/m-p/131424#M45741

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,002)