Set value of Check box field
Function: Set value of Check box field
This function allows you to select an option within a specific Checkbox field on your application's form. When you use this action, the chosen answer is added to the list of selected options for that Checkbox field, making it available for further steps in your application's logic.
Input
- UI element (Checkbox field): This is the specific Checkbox field on your form where you want to add an answer. You must provide a valid Checkbox field for this action to work.
- Answer: This is the exact text of the option you wish to select within the chosen Checkbox field. This value cannot be empty and must match one of the predefined choices available in the Checkbox field.
Output
This function does not produce a direct output that you can use in subsequent steps. Instead, it updates the internal state of the specified Checkbox field by adding the provided answer to its list of selected options.
Execution Flow
Real-Life Examples
Here are some examples of how you might use the "Set value of Check box field" function:
Example 1: Selecting a single preference
Imagine you have a "Newsletter Preferences" form with a Checkbox field named "Topics of Interest" that allows users to select multiple topics. You want to automatically select "Product Updates" when a user signs up.
- Inputs:
- UI element (Checkbox field):
Topics of Interest(the Checkbox field on your form) - Answer:
Product Updates
- UI element (Checkbox field):
- Result: The "Product Updates" option within the "Topics of Interest" Checkbox field will now be selected.
Example 2: Adding another option to an existing selection
Suppose a user has already selected "Email Notifications" in a "Communication Methods" Checkbox field. Later in the process, based on their role, you also want to automatically select "SMS Alerts" without deselecting "Email Notifications".
- Inputs:
- UI element (Checkbox field):
Communication Methods(the Checkbox field on your form) - Answer:
SMS Alerts
- UI element (Checkbox field):
- Result: The "SMS Alerts" option will be added to the selected options of the "Communication Methods" Checkbox field. If "Email Notifications" was already selected, it will remain selected, and now both will be chosen.
Example 3: Attempting to select an invalid option
You have a Checkbox field called "Preferred Colors" with options "Red", "Blue", and "Green". A user accidentally tries to set "Yellow" as an answer.
- Inputs:
- UI element (Checkbox field):
Preferred Colors - Answer:
Yellow
- UI element (Checkbox field):
- Result: The action will fail, and an error message will indicate that "Yellow" is not a valid option for the "Preferred Colors" Checkbox field. The state of the "Preferred Colors" field will remain unchanged.