Remove a set of matches from a list
Function: Remove a set of matches from a list
This action helps you clean up your lists by removing items that meet specific criteria. You can define one or more filters to identify the items you want to remove, and the action will process your list, leaving only the items that do not match your specified conditions.
Input
- List: The list of items you want to modify. This can be a list of simple values or a list of more complex items (like customer records or product details).
- Filters: This is where you define the rules for which items to remove. You can add multiple filters, and an item will be removed if it matches all the conditions you set.
- Attribute: Choose a specific property or field within each item of your list that you want to check. For example, if your list contains products, you might choose "Category" or "Price".
- Operator: Select how the chosen attribute should be compared to a value. Options include:
- Equal: The attribute's value must be exactly the same as your specified value.
- Greater than: The attribute's value must be numerically larger than your specified value.
- Greater than or equal: The attribute's value must be numerically larger than or equal to your specified value.
- In: The attribute's value must be present within a list of values you provide.
- Less than: The attribute's value must be numerically smaller than your specified value.
- Less than or equal: The attribute's value must be numerically smaller than or equal to your specified value.
- Not equal: The attribute's value must not be the same as your specified value.
- Not in: The attribute's value must not be present within a list of values you provide.
- Contains: The attribute's text value must include your specified text.
- Contains (ignore case): The attribute's text value must include your specified text, without regard to uppercase or lowercase letters.
- Starts with: The attribute's text value must begin with your specified text.
- Ends with: The attribute's text value must end with your specified text.
- Value: Enter the specific value you want to compare against the chosen attribute. The type of value you enter (text, number, date, etc.) should match the type of the attribute.
Output
- Modified List: The original list, but with all items that matched your filter criteria removed.
Execution Flow
Real-Life Examples
Example 1: Removing out-of-stock products from an online store's display
Imagine you have a list of all products in your inventory, and you want to update your website to only show products that are currently in stock.
- Inputs:
- List:
[\{ "Name": "Laptop", "Category": "Electronics", "Stock": 5 \}, \{ "Name": "Mouse", "Category": "Accessories", "Stock": 0 \}, \{ "Name": "Keyboard", "Category": "Accessories", "Stock": 10 \}, \{ "Name": "Monitor", "Category": "Electronics", "Stock": 0 \}] - Filters:
- Attribute:
Stock - Operator:
Equal - Value:
0
- Attribute:
- List:
- Result: The product list will be updated to
[\{ "Name": "Laptop", "Category": "Electronics", "Stock": 5 \}, \{ "Name": "Keyboard", "Category": "Accessories", "Stock": 10 \}]. The "Mouse" and "Monitor" products, which had 0 stock, are removed.
Example 2: Cleaning up a customer contact list by removing inactive users
You maintain a list of customer contacts and want to remove any customers whose status is "Inactive" to streamline your marketing efforts.
- Inputs:
- List:
[\{ "ID": 101, "Name": "Alice", "Status": "Active" \}, \{ "ID": 102, "Name": "Bob", "Status": "Inactive" \}, \{ "ID": 103, "Name": "Charlie", "Status": "Active" \}, \{ "ID": 104, "Name": "David", "Status": "Inactive" \}] - Filters:
- Attribute:
Status - Operator:
Equal - Value:
"Inactive"
- Attribute:
- List:
- Result: The customer list will be updated to
[\{ "ID": 101, "Name": "Alice", "Status": "Active" \}, \{ "ID": 103, "Name": "Charlie", "Status": "Active" \}]. All customers marked as "Inactive" are removed.
Example 3: Filtering out completed tasks from a project task list
You have a list of project tasks and want to view only the tasks that are still pending, removing any that have been marked as "Done".
- Inputs:
- List:
[\{ "Task": "Design UI", "Priority": "High", "Progress": "Done" \}, \{ "Task": "Develop Backend", "Priority": "High", "Progress": "In Progress" \}, \{ "Task": "Write Documentation", "Priority": "Medium", "Progress": "To Do" \}, \{ "Task": "Test Features", "Priority": "High", "Progress": "Done" \}] - Filters:
- Attribute:
Progress - Operator:
Equal - Value:
"Done"
- Attribute:
- List:
- Result: The task list will be updated to
[\{ "Task": "Develop Backend", "Priority": "High", "Progress": "In Progress" \}, \{ "Task": "Write Documentation", "Priority": "Medium", "Progress": "To Do" \}]. The "Design UI" and "Test Features" tasks, which were "Done", are removed.