Get label of radiobutton field
Function: Get label of radiobutton field
This action helps you retrieve the text (label) of the option that a user has selected in a Radio Button Field on your application's screen. Once retrieved, this label is saved into a variable, ready for you to use in other parts of your application, like displaying it in a message or saving it to a database.
Input
- UI element: The specific Radio Button Field component on your application's screen from which you want to get the selected option's label. This must be a Radio Button Field component.
Output
- Answer label: The name of the variable where the selected option's label (text) will be stored. By default, this variable is named
RADIOBUTTON_FIELD_ANSWER_LABEL, but you can change it to something more descriptive if needed.
Execution Flow
Real-Life Examples
Here are some ways you can use the "Get label of radiobutton field" action in your application:
Example 1: Displaying a user's choice in a confirmation message
Imagine you have a form where users select their preferred contact method (Email, Phone, SMS) using a Radio Button Field. After they submit the form, you want to show a confirmation message that includes their chosen method.
- Inputs:
- UI element: "Preferred Contact Method (Radio Button Field)"
- Result: If the user selected "Email", the variable
RADIOBUTTON_FIELD_ANSWER_LABELwill contain the text "Email". You can then use this variable in a message like: "Thank you! Your preferred contact method is: Email."
Example 2: Saving a survey response to a database
You're building a customer satisfaction survey where users rate their experience (Excellent, Good, Fair, Poor) using a Radio Button Field. You want to save their exact rating text into your database.
- Inputs:
- UI element: "Customer Satisfaction Rating (Radio Button Field)"
- Answer label:
CustomerRatingText(custom variable name)
- Result: If the user selected "Good", the variable
CustomerRatingTextwill contain "Good". You can then use thisCustomerRatingTextvariable to update a record in your customer database.
Example 3: Triggering conditional logic based on a selection
Suppose you have a product configuration page where users choose a "Subscription Type" (Basic, Standard, Premium) via a Radio Button Field. If they select "Premium", you want to display additional options.
- Inputs:
- UI element: "Subscription Type (Radio Button Field)"
- Result: If the user selected "Premium", the variable
RADIOBUTTON_FIELD_ANSWER_LABELwill contain "Premium". You can then set up a condition: "IfRADIOBUTTON_FIELD_ANSWER_LABELis 'Premium', then show the 'Premium Features' section."