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" component on your application's forms. A slide-toggle is a user interface element that typically represents a binary choice, like "On/Off" or "Yes/No." By using this action, you can set its value to either True (on/yes) or False (off/no), influencing how your application behaves or what data is collected.
Input,
- UI element: This is the specific slide-toggle component on your form that you want to modify. You must select the exact slide-toggle field you intend to update.
- Answer: This is the desired state you want to set for the selected slide-toggle field. You can choose
Trueto turn it "on" orFalseto turn it "off." If you do not provide a value, the slide-toggle will default toFalse.
Output,
No direct output parameters. This action updates the state of the specified slide-toggle field within the current process, making the change visible on the form and available for subsequent actions.
Execution Flow,
Real-Life Examples,
-
Example: Setting a default preference on a user profile.
- Scenario: When a new user signs up, you want to automatically subscribe them to your newsletter by default, but still allow them to change it.
- Inputs:
- UI element:
Newsletter Subscription Toggle(the slide-toggle field on the user profile form) - Answer:
True
- UI element:
- Result: The "Newsletter Subscription" slide-toggle on the new user's profile form will be set to
True(On) automatically.
-
Example: Enabling an option based on another selection.
- Scenario: On an order form, if a customer selects "Express Shipping," you want to automatically enable a "Receive SMS Updates" toggle, as express orders often benefit from real-time notifications.
- Inputs:
- UI element:
Receive SMS Updates Toggle(the slide-toggle field) - Answer:
True
- UI element:
- Result: When "Express Shipping" is chosen, the "Receive SMS Updates" slide-toggle will automatically switch to
True(On).
-
Example: Resetting a form field after submission.
- Scenario: After a user successfully submits a feedback form, you want to clear the form for the next entry, including resetting a "Allow Follow-up Contact" toggle to its default
Falsestate. - Inputs:
- UI element:
Allow Follow-up Contact Toggle(the slide-toggle field on the feedback form) - Answer:
False
- UI element:
- Result: After the feedback form is submitted, the "Allow Follow-up Contact" slide-toggle will be reset to
False(Off), ready for the next user.
- Scenario: After a user successfully submits a feedback form, you want to clear the form for the next entry, including resetting a "Allow Follow-up Contact" toggle to its default