Set value of chips input field
Function: Set value of chips input field
This action allows you to update the selected items (often called "chips" or "tags") within a Chips Input Field on your application's form. It takes the specific UI element you want to modify and a list of new values, then updates the field with these values. This makes the updated selections available for other actions or for saving.
Input
- UI element (PART, required): This is the specific Chips Input Field on your form that you want to update. You will select it directly from your application's interface.
- Answers (ARRAY): A list of values that you want to set as the new selected items in the chosen Chips Input Field. Each item in this list will become a "chip" in the field. Providing an empty list
[]will clear all existing selections from the field.
Output
No direct output. This action updates the specified UI element internally, making its new state available within the application.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Set value of chips input field" action:
-
Setting Pre-selected Tags for a Product:
- Scenario: You have a product creation form, and you want to automatically assign some default tags to new products based on their category.
- Inputs:
- UI element: Select the "Product Tags" Chips Input Field on your form.
- Answers:
["New Arrival", "Best Seller", "Online Exclusive"]
- Result: The "Product Tags" field on the product creation form will automatically display "New Arrival", "Best Seller", and "Online Exclusive" as selected tags when the form loads or after a specific event.
-
Clearing User Preferences:
- Scenario: A user wants to reset their selected interests on their profile page.
- Inputs:
- UI element: Select the "User Interests" Chips Input Field on the user's profile.
- Answers:
[](an empty list)
- Result: The "User Interests" field on the user's profile page will be cleared, showing no selected interests, effectively resetting their preferences.
-
Updating Selected Categories Based on Another Selection:
- Scenario: You have a form for creating articles. When a user selects a "Main Topic" from a dropdown, you want to automatically populate the "Sub-Categories" Chips Input Field with relevant options.
- Inputs:
- UI element: Select the "Sub-Categories" Chips Input Field.
- Answers:
["Programming", "Web Development", "Databases"](This list would be dynamically generated based on the "Main Topic" selection, e.g., if "Technology" was chosen).
- Result: The "Sub-Categories" field will update to show "Programming", "Web Development", and "Databases" as the chosen categories, reflecting the main topic selection.