Set values of Check box field
Function: Set values of Check box field
This function allows you to update the selected options within a Checkbox UI element on your application's form. It takes a specific Checkbox field and a list of answers, then sets those answers as the currently selected choices for that field. This is useful for pre-filling forms, dynamically changing user selections, or clearing all selections.
Input
- UI element (PART): This is the specific Checkbox field on your form that you want to modify. You need to select or reference the Checkbox UI element here. This input is required.
- Answers (ARRAY of STRING): This is a list of text values that you want to set as the selected answers for the chosen "Checkbox UI element". Each value in this list must correspond to one of the available choices in the Checkbox field. If a provided answer does not match an existing choice, the action will stop with an error. While this input is optional, it must be provided as either a list of values (e.g.,
["Option A", "Option B"]) or an empty list[]to clear all selections. If this input is completely missing or left blank (resulting in a null value), the action will result in an error.
Output
This function does not produce any explicit output. Its primary effect is to modify the state of the specified Checkbox UI element within your application.
Execution Flow
Real-Life Examples
-
Pre-filling a survey form based on user profile:
- Inputs:
- UI element:
Checkbox Field: "Preferred Communication Channels" - Answers:
["Email", "SMS"]
- UI element:
- Result: The "Preferred Communication Channels" checkbox field on the survey form will automatically have "Email" and "SMS" selected, allowing the user to quickly review or modify their choices.
- Inputs:
-
Clearing all selections in a filter:
- Inputs:
- UI element:
Checkbox Field: "Product Categories Filter" - Answers:
[](an empty list)
- UI element:
- Result: All previously selected product categories in the "Product Categories Filter" checkbox field will be deselected, effectively clearing the user's filter choices.
- Inputs:
-
Updating access permissions based on a workflow step:
- Inputs:
- UI element:
Checkbox Field: "User Permissions" - Answers:
["View Reports", "Edit Profile"]
- UI element:
- Result: After a specific workflow step, the "User Permissions" checkbox field will be updated to show "View Reports" and "Edit Profile" as selected, reflecting the user's allowed actions for that stage. If an answer like "Delete Data" was provided but is not an available option in the checkbox field, the action would stop with an error.
- Inputs: