Set value of slider field
Function: Set value of slider field
This action allows you to programmatically set the value of a Slider Field component on your form. This is useful for pre-filling forms, updating values based on other logic, or resetting a slider to a specific value.
Input
- UI element (Required): This is the specific Slider Field component on your form that you want to modify. You'll select it directly from your application's design interface.
- Answer (Optional): This is the numerical value you want to set for the selected Slider Field. If left empty, the slider field's value will be cleared or reset to its default, depending on its configuration.
Output
This action does not produce any direct output. Its effect is to update the specified Slider Field component within your application.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Set value of slider field" action in your application:
Example 1: Pre-filling a customer satisfaction survey
Imagine you have a customer survey form with a "Satisfaction Rating" slider. After a customer completes a purchase, you want to automatically set this slider to a default value (e.g., 5 out of 10) to encourage them to provide feedback.
- Inputs:
- UI element:
Satisfaction Rating Slider - Answer:
5
- UI element:
- Result: When the survey form loads, the "Satisfaction Rating Slider" is automatically positioned at the value of 5.
Example 2: Resetting a quantity selector
You have an order form where users can select the quantity of an item using a slider. If the user clicks a "Clear Order" button, you want to reset all quantity sliders to their minimum or default state.
- Inputs:
- UI element:
Quantity Selector Slider - Answer: (Leave empty)
- UI element:
- Result: The "Quantity Selector Slider" is cleared or reset to its default minimum value (e.g., 0 or 1), effectively removing the item from the order.
Example 3: Dynamically adjusting a discount slider based on total purchase
In an e-commerce application, you might want to offer a higher discount percentage if the total purchase value exceeds a certain amount. You can use this action to update a "Discount Percentage" slider based on a calculated total.
- Inputs:
- UI element:
Discount Percentage Slider - Answer:
10(This value would come from a previous calculation, e.g., if total purchase > $1000, set discount to 10%)
- UI element:
- Result: The "Discount Percentage Slider" on the checkout page is automatically set to 10%, reflecting the calculated discount.