Get value of slide-toggle field
Function: Get value of slide-toggle field
Description, This function allows you to retrieve the current state of a "slide-toggle" user interface element on your application's page. A slide-toggle is typically an on/off switch. This action will tell you if the switch is currently "on" (True) or "off" (False) and store this information in a variable for you to use in subsequent steps.
Input,
- UI element (Type: PART, required): This is the specific slide-toggle component on your form or page whose value you want to retrieve. You must select a UI element that is specifically a "slide-toggle" type.
Output,
- Answer (Type: BOOLEAN): A variable that will hold the result. If the slide-toggle is in the "on" position, this variable will be
True. If it's in the "off" position, it will beFalse. By default, this variable is namedSLIDE_TOGGLE_FIELD_ANSWER, but you can choose a different name.
Execution Flow,
Real-Life Examples,
-
Checking User Preferences for Notifications
- Scenario: On a user profile page, there's a slide-toggle labeled "Receive Email Notifications." You want to know if the user has this option enabled.
- Inputs:
- UI element: Select the "Receive Email Notifications" slide-toggle from your page.
- Answer:
userNotificationsEnabled
- Result: The variable
userNotificationsEnabledwill now holdTrueif the user wants email notifications, orFalseif they don't. You can then use this variable to update their profile in your database.
-
Conditional Display of Information
- Scenario: You have a form where users can indicate if they are "Opting into Beta Features." If they opt-in, you want to show an additional section with beta-specific settings.
- Inputs:
- UI element: Select the "Opt into Beta Features" slide-toggle.
- Answer:
isBetaUser
- Result: The variable
isBetaUserwill beTrueif the toggle is on, andFalseif it's off. You can then use thisisBetaUservariable in a conditional logic block to either show or hide the beta settings section on the page.
-
Automating Workflow Based on Approval
- Scenario: In an approval workflow, a manager reviews a request and uses a slide-toggle labeled "Approve Request" to make their decision. You need to capture this decision to proceed with the workflow.
- Inputs:
- UI element: Select the "Approve Request" slide-toggle.
- Answer:
requestApproved
- Result: The variable
requestApprovedwill beTrueif the manager approved the request (toggle is on), orFalseif they did not (toggle is off). ThisrequestApprovedvariable can then trigger the next step in your workflow, such as sending an approval email or routing the request for further review.