Get value of radiobutton field
Function: Get value of radiobutton field
This action allows you to retrieve the currently selected option from a Radio Button UI element on your application's screen. It then stores this selected value into a variable, making it available for use in subsequent actions or logic within your application. This is useful for capturing user choices made through radio buttons.
Input
- UI element
- Type: PART (specifically a Radio Button Field)
- Description: This is the specific Radio Button UI element on your page from which you want to get the selected value. You must select a UI element that is configured as a "radiobutton-field".
- Required: Yes
Output
- Answer
- Type: STRING
- Description: This is the name of the variable where the selected value from the Radio Button UI element will be stored. If not specified, the default variable name will be
RADIOBUTTON_FIELD_ANSWER. - Default Value:
RADIOBUTTON_FIELD_ANSWER
Execution Flow
Real-Life Examples
Example 1: Capturing a User's Consent
Imagine you have a form where users need to agree to terms and conditions using a "Yes" or "No" radio button.
- Inputs:
- UI element:
Terms and Conditions Consent Radio Button(This refers to the actual radio button field on your form.) - Answer:
UserConsent
- UI element:
- Result: If the user selects "Yes", the variable
UserConsentwill hold the value "Yes". If they select "No", it will hold "No". You can then use thisUserConsentvariable in a conditional action to proceed or halt the process.
Example 2: Determining a Preferred Communication Method
In a user profile update form, you might ask users to choose their preferred communication method (Email, Phone, SMS) using radio buttons.
- Inputs:
- UI element:
Preferred Communication Method Radio Button - Answer:
PreferredMethod
- UI element:
- Result: If the user selects "Email", the variable
PreferredMethodwill store "Email". This value can then be used to update their profile in your database or trigger a specific notification workflow.
Example 3: Selecting a Product Option
Consider an e-commerce product page where a customer chooses a product size (Small, Medium, Large) using radio buttons.
- Inputs:
- UI element:
Product Size Selection Radio Button - Answer:
SelectedProductSize
- UI element:
- Result: If the customer selects "Medium", the variable
SelectedProductSizewill contain "Medium". This information is crucial for adding the correct product variant to their shopping cart.