cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RameshMukka
Post Prodigy
Post Prodigy

Radio button retain its previous value even after Reset

I have this simple radio button with items Yes, No. 

 

RameshMukka_0-1653385919339.png

I have below formula at OnSelect of the Submit button.

Patch(Binaries,Defaults(Binaries),{Title:Radio1.Selected.Value});UpdateContext({varResetRadio: true})

 

I have placed my context variable varResetRadio at Reset property of the radio button.

RameshMukka_1-1653386080796.png

 

Now I have placed a label on the screen to check the current value selected in radio options. I have put Radio1.Selected.Value at text property of the label.

RameshMukka_2-1653386374442.png

 

Now when I click on submit, neither the label value becomes blank nor the radio button resets. But when I take another button to reset the radio control with Reset(radio1), it resets perfectly. Am I doing something wrong in this simple action? Or is this a bug when I use a variable at Reset property of radio button?

 

Thanks in advance,

Ramesh Mukka

 

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User
Super User

Hi,

 

When using the reset property, the value needs to be set to false manually, then to true, then to false again. I would recommend just to use the reset function instead as you have done, and replace your UpdateContext with reset instead:

Patch(
      Binaries,Defaults(Binaries),
      {Title:Radio1.Selected.Value});
Reset(Radio1)

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

4 REPLIES 4
iAm_ManCat
Super User
Super User

Hi,

 

When using the reset property, the value needs to be set to false manually, then to true, then to false again. I would recommend just to use the reset function instead as you have done, and replace your UpdateContext with reset instead:

Patch(
      Binaries,Defaults(Binaries),
      {Title:Radio1.Selected.Value});
Reset(Radio1)

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


@iAm_ManCat Thank you for taking some time. My actual problem was on my app where am building with close to 100 input controls. So idea was to reset them at Form Submit so I was using this Reset property with variable instead using Reset() function for all those 100+ controls. How would you want me to do in this case?

Are all of your controls in the form? If Yes, then use 

ResetForm(FormName); NewForm(Formname)

EditForm, NewForm, SubmitForm, ResetForm, and ViewForm functions in Power Apps - Power Apps | Micros...

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


@iAm_ManCat 

No, I am not using a form control. So I went for Reset property using variable as that was easy. And used below formula as you suggested. It worked. Thanks a lot.

 

 

 Set(
        varResetCtrls,
        false
    );
    Set(
        varResetCtrls,
        true
    );
    Set(
        varResetCtrls,
        false
    );

 

Helpful resources

Announcements
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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,217)