cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrittanyR
Helper III
Helper III

Radio button display name and value

I am not sure if this is possible, but can we have a display text for a radio button and a value? For example the display text for an option to be: "Hello world" but the value when selected = true? I am not finding anything in the documentation that refers to this. 
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-radio

1 ACCEPTED SOLUTION

Accepted Solutions
Patch
Frequent Visitor

This is pretty simple using the Table function for the Radio button's Items property. 

 

Table({Key: "Hello World", Value:1},{Key: "Good By World", Value:2})

 

This will result in the Radio button selected value being a record. This means you can use the Radio button's Selected property to define the value you have assigned in the table.

 

Radio1.Selected.Value

 

 So when Radio1.Selected text is "Hello World" the Radio1.Selected value will be "1". 

View solution in original post

6 REPLIES 6
eka24
Super User
Super User

You can use a workaround logic like;

If ( Radio1.Selected.Value="Hello World",true,false)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

v-qiaqi-msft
Community Support
Community Support

Hi@BrittanyR,

Based on the issue that you mentioned, do you want to display a text like "Hello World" when you on selecting the Radio button options?

Could you please share a bit more about the scenario, do you want to set the boolean values for the Radion button options?

If my understanding is correct, I am afraid that there is no way to achieve this currently in PowerApps.

You want to set two options like true or false for the Radio button. Further, when you select the true option, the Radio button should display "Hello World" rather than "true". The Radio button does have the display text, but it displays only depends on the Items property you set for it. If you set the Items as a Table containing items like "true" or "false", the Radio button only displays the corresponding item to what you select.

As an alternative solution, if you want to display a custom text when the Radio button selected value is "true", I think controlling the Visible property of a Label could achieve your needs.

I have a test on my side, please take a try as below:

Set the Items property of the Radio button as below:

 

["true","false"]

 

Add a Label and set the Text property as below:

 

"Hello World"

 

Set the Visible property of the Label as below:

 

If(Radio1.Selected.Value="true",true,false)

Note: Every time you select the true option, the Label will pop up to display the "Hello World".

 

If this could not solve your problem, please provide more details.

Best Regards,

Qi

Best Regards,
Qi

@v-qiaqi-msft  no, I want to do like a text/value for the radio button, in that the first option says "Hello world" but when selected its inner value = 1, second option = "Hello world 2" but when selected value = 2. 

Can you explain further the inner value?

Possible a screenshot will help.

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Patch
Frequent Visitor

This is pretty simple using the Table function for the Radio button's Items property. 

 

Table({Key: "Hello World", Value:1},{Key: "Good By World", Value:2})

 

This will result in the Radio button selected value being a record. This means you can use the Radio button's Selected property to define the value you have assigned in the table.

 

Radio1.Selected.Value

 

 So when Radio1.Selected text is "Hello World" the Radio1.Selected value will be "1". 

View solution in original post

Exactly what I needed! Thanks. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,262)