Set value of dropdown field
Function: Set value of dropdown field
This action allows you to dynamically change the selected option in a dropdown field on your form. You can either set it to a specific value from its available choices or clear its current selection. This is useful for guiding users, pre-filling forms, or reacting to other user inputs.
Input
- UI element: The specific dropdown field component on your form that you want to modify. This input is required and must be a dropdown field.
- Answer: The text value you wish to set as the selected option in the dropdown. This value must exactly match one of the available choices in the dropdown. If you leave this input empty, the dropdown field's current selection will be cleared.
Output
This action does not produce a direct output value. Instead, it updates the selected value of the specified dropdown field on your form. This change is then available for other actions or parts of your application to use.
Execution Flow
Real-Life Examples
Example 1: Pre-filling a country selection
- Scenario: You have a form where users select their country. Based on a previous step (e.g., IP detection or user profile), you want to pre-fill the country dropdown.
- Inputs:
- UI element:
Country_Dropdown(a dropdown field with choices like "USA", "Canada", "Mexico") - Answer:
Canada
- UI element:
- Result: The
Country_Dropdownfield on your form will automatically show "Canada" as the selected country.
Example 2: Clearing a dependent field
- Scenario: You have two dropdowns: "Category" and "Sub-Category". When the user changes the "Category", you want to clear the "Sub-Category" until new relevant options are loaded.
- Inputs:
- UI element:
SubCategory_Dropdown(a dropdown field) - Answer: (Left empty)
- UI element:
- Result: The
SubCategory_Dropdownfield will have its current selection cleared, appearing blank or showing its default placeholder.
Example 3: Setting a status based on an event
- Scenario: After a user completes a task, you want to update a "Task Status" dropdown field to "Completed".
- Inputs:
- UI element:
TaskStatus_Dropdown(a dropdown field with choices like "Pending", "In Progress", "Completed") - Answer:
Completed
- UI element:
- Result: The
TaskStatus_Dropdownfield will display "Completed" as its selected value. If "Completed" was not an available choice in the dropdown, an error would occur, and the field would not change.