cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Radio-button reset stopped working

I've got a multi-page quiz where the answers are in the form of radio buttons. On the first page there's a normal button (Button4_18) I used to use to reset the radio buttons (in case someone takes the quiz multiple times). The code looked like this:

Navigate(pagename; ScreenTransition.Fade) And Set(somevariable;0) And Reset(Radio1;;Radio1_1;;Radio1_2;;Radio1_3;;Radio1_4;;Radio1_5;;Radio1_6;;Radio1_7;;Radio1_8;;Radio1_9;;Radio1_10;;Radio1_11;;Radio1_12;;Radio1_13;;Radio1_14;;Radio1_15)

 

One day it just stopped working; only the last item on the list (Radio1_15) gets reset now (and it's not because of that particular radio button's properties; any radio button that's last on the list gets reset). For now I can get around the problem by setting the Reset property of all radio buttons to Button4_18.Pressed, but I'd still be interesting to know why the other method suddenly stopped working.

10 REPLIES 10
Sofie_D
Responsive Resident
Responsive Resident

You should have a different Reset function for every control. Change it to Reset(Radio1);;Reset(Radio2);;... and it should work

Anonymous
Not applicable

I thought ";;" was a way to chain them so I wouldn't have to keep writing "Reset" so many times (and bear in mind that it used to work just fine). I know you can use And (or &&) but that doesn't get around the problem of having to repeat "Reset".

Sofie_D
Responsive Resident
Responsive Resident

As far as I know there is no way to chain them together, though I could be wrong.

Rick72
Impactful Individual
Impactful Individual

Chaining in ONE function is not possible: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-reset

 

Chaining the functions (Reset(Control1);Reset(Control2);...) is.

 

Robot Happy Rick

Hi @Sofie_D and @Rick72 

Is this issue has been solved? 

What is the exact solution?

Because i have the same issue here, and either way its not working.

 

Please help.

 

BR,

PytByt

rebeccas
Community Champion
Community Champion

Reset(RadioButton) used to work but somewhere along the way with updates it no longer does (or doesn't for me anyhow...I get errors). 

 

I use the same thing I do on checkboxes and other resets. 

 

Screen OnVisible = UpdateContext({ResetRB:true});UpdateContext({ResetRB:false})

 

Radio Button - Reset = ResetRB

 

You can put it that same UpdateContext on other places besides the screens on visible if you want too...basically anything you want triggering a reset that needs to go.

This has been very helpful, the only issue I have is I have 4 sets of radio button on the same form and it only works on the first one. I have tried adding Rest = ResetRB to the other 3 Radio buttons but it does not work, I have also tried in the screen on visible adding

 

 UpdateContext({ResetRB1:true});UpdateContext({ResetRB1:false}); UpdateContext({ResetRB2:true});UpdateContext({ResetRB2:false}) etc

Then Reset - ResetRB1 on radio one and REset= ResetRB2 etc but that does not work.

 

Can you give me just a bit more insight in to how this works was ResetRB just a context name you made up or does it have any special properties?

 

Many thanks

 

 

rebeccas
Community Champion
Community Champion

That is just the name I use that I kept as an example...you can put any text you want for that. 

 

The only time I create a separate one is if I want them to reset at different times. If you want them to all reset on the screens visible then I would not suggest you trying to split them out...it should not help anything and just unnecessary.

 

If you have the Reset on the Radio buttons set to the variable (ResetRB...or whatever you choose to call it) and it is not working correctly you might check the default of the radio button. Resetting it is going to put it back to the default and if you don't give it a default value such as "Yes" or "No"...or whatever you want it to be then it won't know what it is resetting it to and will not work.

Thanks for that, it was very helpful.  I think my issue is now only when moving onto the next row when the fields associated with the radio buttons are blank. I need to somehow when the field is blank set all 3 buttons(yes/No/Na) to blank.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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