Set value of radiobutton field
Function: Set value of radiobutton field
This function allows you to programmatically select an option within a radio button field on your application's forms. When this action runs, it updates the chosen radio button field to reflect the selected answer, making that choice available for subsequent steps in your application's logic or for display to the user.
Input
- UI element (Type: UI Element, Required: Yes) The specific radio button field on your form that you want to update. You must select a UI element that is configured as a radio button field.
- Answer (Type: Text, Required: Yes) The exact text of the option you want to select within the chosen radio button field. This value must precisely match one of the available choices defined for that radio button field. If the provided answer does not match an existing choice, the action will fail.
Output
No direct output is returned by this function. The action's effect is to update the selected value of the specified radio button field within your application.
Execution Flow
Real-Life Examples
Here are some practical examples of how you can use the "Set value of radiobutton field" function:
Example 1: Pre-selecting a default shipping option
Imagine you have an order form where customers can choose their shipping method. You want to automatically select "Standard Shipping" if it's available.
- Inputs:
- UI element: "Shipping Method" (a radio button field with options like "Standard Shipping", "Express Shipping", "Next-Day Delivery")
- Answer: "Standard Shipping"
- Result: The "Standard Shipping" option is automatically selected in the "Shipping Method" radio button field on the order form.
Example 2: Updating a user's preference based on their profile
Suppose your application has a user profile page where users can set their preferred notification method. When the page loads, you want to display their saved preference.
- Inputs:
- UI element: "Notification Preference" (a radio button field with options like "Email", "SMS", "Push Notification")
- Answer: "Email" (assuming this was retrieved from the user's saved profile)
- Result: The "Email" option is selected in the "Notification Preference" radio button field, reflecting the user's saved choice.
Example 3: Responding to a conditional logic trigger
You have a survey where if a user selects "Yes" to a previous question, a follow-up radio button field should automatically select a specific option.
- Inputs:
- UI element: "Follow-up Action" (a radio button field with options like "Schedule Call", "Send Info Pack", "No Action Needed")
- Answer: "Send Info Pack"
- Result: After the user selects "Yes" on the preceding question, the "Send Info Pack" option is automatically selected in the "Follow-up Action" radio button field.