Set value of radiobutton field
Function: Set value of radiobutton field
This function allows you to update the selected option within a Radio Button field on your form. It's useful for pre-filling a form, changing a selection based on other user inputs, or setting a default choice. The updated value is then available for other actions or for saving.
Input
- UI element (PART): This is the specific Radio Button field on your form that you want to modify. You'll typically select it from a list of available UI elements. This input is required.
- Answer (STRING): This is the text value of the option you want to select within the chosen Radio Button field. For example, if your radio buttons are "Yes", "No", "Maybe", you would provide "Yes" or "No" or "Maybe" here. While this input is technically optional, if provided, it must exactly match one of the available choices in the Radio Button field. If no value is provided, or if the provided value does not match an existing choice, the action will result in an error.
Output
No direct output is returned by this function. The selected value of the Radio Button field is updated internally for further processing within your application.
Execution Flow
Real-Life Examples
Here are some real-life scenarios demonstrating how to use the "Set value of radiobutton field" function:
Example 1: Pre-filling a form based on user data
- Scenario: You have a user profile form, and you want to pre-select the user's preferred contact method (Email, Phone, or SMS) in a radio button field based on their existing profile information.
- Inputs:
- UI element:
Preferred_Contact_Method_Radiobutton(This is the radio button field on your form) - Answer:
Email(Assuming "Email" is one of the options in the radio button field)
- UI element:
- Result: When the user opens the profile form, the "Email" option in the "Preferred Contact Method" radio button field is automatically selected.
Example 2: Changing selection based on another field's input
- Scenario: On an order form, if a user selects "Yes" for "Is this a gift?", you want to automatically set the "Gift Wrapping" radio button to "Standard" as a default, which they can then change.
- Inputs:
- UI element:
Gift_Wrapping_Option_Radiobutton(This is the radio button field for gift wrapping) - Answer:
Standard(Assuming "Standard" is an option for gift wrapping)
- UI element:
- Result: After the user selects "Yes" for "Is this a gift?", the "Standard" option in the "Gift Wrapping" radio button field is automatically selected.
Example 3: Setting a default choice for a new entry
- Scenario: When creating a new task in a project management application, the "Priority" radio button field should always default to "Medium" to ensure a baseline priority is set.
- Inputs:
- UI element:
Task_Priority_Radiobutton(This is the radio button field for task priority) - Answer:
Medium(Assuming "Medium" is one of the priority options)
- UI element:
- Result: Whenever a new task entry form is opened, the "Medium" option is pre-selected in the "Priority" radio button field, saving the user a click.