cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Robert94
Responsive Resident
Responsive Resident

How can I make 2 radio buttons, if one is Yes the other is No and Viceversa, I keep getting circular error no matter what I do.

{E135C0CB-679F-44FD-8492-E2C8A8959BD4}.png

1 ACCEPTED SOLUTION

Accepted Solutions
MM_Factor
Frequent Visitor

Try this:
- create two variables (var_radio1, var_radio2)

- set default value of radio button with these variables

- use 'OnSelect' function in Radio1 and paste:
Set(var_radio1,Self.Selected.Value);Set(var_radio2,If(Self.Selected.Value = "Yes","No","Yes"))

- use 'OnSelect' function in Radio2 and paste:

Set(var_radio2,Self.Selected.Value);Set(var_radio1,If(Self.Selected.Value = "Yes","No","Yes"))

 

It works on my PA

View solution in original post

6 REPLIES 6
Himanshu_90677
Super User
Super User

@Robert94 

try this

Radio2 Default =

If(Radio1.Selected.Value = Text("Yes"),"No","Yes")

it's working in my powerapp

 

And what about radio1 default?

Let me check

MM_Factor
Frequent Visitor

Try this:
- create two variables (var_radio1, var_radio2)

- set default value of radio button with these variables

- use 'OnSelect' function in Radio1 and paste:
Set(var_radio1,Self.Selected.Value);Set(var_radio2,If(Self.Selected.Value = "Yes","No","Yes"))

- use 'OnSelect' function in Radio2 and paste:

Set(var_radio2,Self.Selected.Value);Set(var_radio1,If(Self.Selected.Value = "Yes","No","Yes"))

 

It works on my PA

Yes it works @MM_Factor  you did it

Works really nice, but those radio are from a form, in this way will I be able to submit those answers and retrieve them whenver I reopen that exact form, I basically also want to have the default as ThisItem.radio1 for example,for when reopening the submitted form.

Edit: It works!

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.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,584)