Remove dropdown choice
Function: Remove dropdown choice
This action allows you to remove a specific option from a dropdown menu in your application. This is useful for dynamically updating the choices available to users, for example, when an option becomes unavailable or irrelevant.
Input
- UI element (Dropdown Field) The specific dropdown field component on your page from which you want to remove an option. You will select this directly from your application's UI.
- Code of choice to remove (Text) The unique identifier or 'code' associated with the option you wish to remove from the dropdown. This code is typically set when the option was originally added or defined.
Output
After this action runs, the specified dropdown field will no longer display the choice corresponding to the provided code. No explicit data is returned by the action itself.
Execution Flow
Real-Life Examples
Here are some practical scenarios where you might use the "Remove dropdown choice" action:
Example 1: Removing an "Out of Stock" product option
Imagine you have a product order form where users select a product from a dropdown. If a product goes out of stock, you want to remove it from the selection.
- Inputs:
- UI element (Dropdown Field):
Product Selection Dropdown - Code of choice to remove (Text):
PROD_SKU_XYZ(wherePROD_SKU_XYZis the unique code for the out-of-stock product)
- UI element (Dropdown Field):
- Result: The
Product Selection Dropdownwill no longer showPROD_SKU_XYZas an available option for users to select.
Example 2: Removing a completed task status
In a task management application, you might have a dropdown for "Task Status" with options like "New", "In Progress", "Pending Review", "Completed". Once a task is marked as "Completed", you might want to remove "New" or "In Progress" as options to prevent incorrect status changes.
- Inputs:
- UI element (Dropdown Field):
Task Status Dropdown - Code of choice to remove (Text):
STATUS_NEW
- UI element (Dropdown Field):
- Result: The
Task Status Dropdownfor that specific task will no longer displaySTATUS_NEWas a selectable option.
Example 3: Adjusting available shipping methods based on destination
For an e-commerce checkout, you might have a "Shipping Method" dropdown. If a customer selects an international destination, certain domestic-only shipping methods should be removed.
- Inputs:
- UI element (Dropdown Field):
Shipping Method Dropdown - Code of choice to remove (Text):
DOMESTIC_STANDARD
- UI element (Dropdown Field):
- Result: The
Shipping Method Dropdownwill dynamically update, removingDOMESTIC_STANDARDfrom the list of choices, ensuring the customer only sees relevant shipping options.