Set value of slide-toggle field
Function: Set value of slide-toggle field
This action allows you to programmatically change the state of a "slide-toggle" switch on your application's user interface. You can turn the switch "On" (True) or "Off" (False). This is useful for automating form filling, controlling UI elements based on business logic, or updating user preferences.
Input
- UI element: This is the specific slide-toggle switch on your form or page that you want to update. You must select an existing slide-toggle component from your application.
- Answer: This is the value you want to set for the slide-toggle switch. You can choose
Trueto turn the switch "On" orFalseto turn it "Off". If you don't provide a value, the switch will default toFalse(Off).
Output
No direct output. The action updates the state of the specified UI element within your application.
Execution Flow
Real-Life Examples
-
Example 1: Automating a preference setting
- Scenario: A user completes a registration form, and you want to automatically enable a "Receive Newsletter" toggle switch based on their input in another field.
- Inputs:
- UI element:
Newsletter_Toggle_Switch(a slide-toggle component on the form) - Answer:
True
- UI element:
- Result: The "Receive Newsletter" slide-toggle switch on the form will automatically be set to "On".
-
Example 2: Resetting a form field
- Scenario: After a user submits a form, you want to clear or reset all fields, including an "Agree to Terms" slide-toggle, to their default "Off" state for the next entry.
- Inputs:
- UI element:
Agree_Terms_Toggle(a slide-toggle component on the form) - Answer:
False
- UI element:
- Result: The "Agree to Terms" slide-toggle switch will be set to "Off".
-
Example 3: Conditional UI update
- Scenario: You have a "Dark Mode" toggle switch. If the user's system preference (detected by another action) is dark mode, you want to automatically set this toggle to "On".
- Inputs:
- UI element:
DarkMode_Toggle(a slide-toggle component on the page) - Answer:
True(assuming the system preference check resulted in True)
- UI element:
- Result: The "Dark Mode" slide-toggle switch will be set to "On", reflecting the user's system preference.