Ask AI
Skip to main content

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 be False. By default, this variable is named SLIDE_TOGGLE_FIELD_ANSWER, but you can choose a different name.

Execution Flow,

Real-Life Examples,

  1. 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 userNotificationsEnabled will now hold True if the user wants email notifications, or False if they don't. You can then use this variable to update their profile in your database.
  2. 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 isBetaUser will be True if the toggle is on, and False if it's off. You can then use this isBetaUser variable in a conditional logic block to either show or hide the beta settings section on the page.
  3. 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 requestApproved will be True if the manager approved the request (toggle is on), or False if they did not (toggle is off). This requestApproved variable can then trigger the next step in your workflow, such as sending an approval email or routing the request for further review.