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

Radio Button OnSelect

Hello

 

How do i give each radio button a different OnSelect function. It seems I can only change the OnSelect function of the "Whole set" of radio buttons?

 

I am a beginner

 

Thank You

Lorcan

2 ACCEPTED SOLUTIONS

Accepted Solutions
Jeff_Thorpe
Super User
Super User

You can use an If or Switch statement fire off different formulas based on what is selected. In the example below I am setting a variable with different values based on what is being selected.

 

Radio Buttons > OnSelect

If(Radio1.Selected.Value = "1", Set(gvTestRadio, "One"), If(Radio1.Selected.Value = "2", Set(gvTestRadio, "Two")))


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

v-monli-msft
Community Support
Community Support

Hi @Anonymous,

 

Like @Jeff_Thorpe suggested, Radio control is recognized as one control for PowerApps. Thus you cannot define each part of Radio in the formula. But you can workaround this by identifying which value is selected in Radio control. Work with IF function, using something like:

If(Radio1.Selected.Value="1", .... , ....)

For more information about IF function, please refer to:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

 

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.

View solution in original post

3 REPLIES 3
Jeff_Thorpe
Super User
Super User

You can use an If or Switch statement fire off different formulas based on what is selected. In the example below I am setting a variable with different values based on what is being selected.

 

Radio Buttons > OnSelect

If(Radio1.Selected.Value = "1", Set(gvTestRadio, "One"), If(Radio1.Selected.Value = "2", Set(gvTestRadio, "Two")))


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
v-monli-msft
Community Support
Community Support

Hi @Anonymous,

 

Like @Jeff_Thorpe suggested, Radio control is recognized as one control for PowerApps. Thus you cannot define each part of Radio in the formula. But you can workaround this by identifying which value is selected in Radio control. Work with IF function, using something like:

If(Radio1.Selected.Value="1", .... , ....)

For more information about IF function, please refer to:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

 

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.
Roza
New Member

Roza_0-1657077706357.png

Can you help me? i want that when user will select "No" option from the  second question will appear dynamically.

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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,662)