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 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
Users online (4,728)