Add a filter to a list of filters
Function: Add a filter to a list of filters
This action helps you build complex search criteria for your data. It allows you to add a single filter condition to an existing list of filters, or to start a brand new list. This is particularly useful when you need to combine multiple conditions to find specific records in your built-in database. If you don't provide an existing list, the action will automatically create a new one for you.
Input
- Data format: The type of data you want to filter (e.g., "Products", "Orders", "Customers"). This helps the system understand which fields (attributes) are available for filtering.
- List of filters:
(Optional) An existing list of filter conditions that you want to add to. If you leave this empty, the action will start a new list with your new filter.
- Each filter in this list is made up of:
- Attribute: A specific field from your chosen "Data format" (e.g., "Product Name", "Order Date", "Customer Email").
- Operator: How you want to compare the attribute's value (e.g., "Equal", "Contains", "Greater than", "Is null").
- Value: The specific value to compare against (e.g., "Laptop", "2023-01-01", "john.doe@example.com"). This field might not be needed for operators like "Is null".
- Each filter in this list is made up of:
- Filter to add:
The new filter condition you want to include in your list. This filter is also made up of:
- Attribute: A specific field from your chosen "Data format".
- Operator: How you want to compare the attribute's value.
- Value: The specific value to compare against. This field might not be needed for operators like "Is null".
Output
- Filter list: The updated list of filters, now including the new filter you just added. This list can then be used in other actions, such as searching your database.
Execution Flow
Real-Life Examples
Example 1: Start a new filter list to find active products in the 'Electronics' category
You want to find all products that are currently active and belong to the "Electronics" category. You'll start by adding the "Electronics" category filter.
- Inputs:
- Data format:
Products - List of filters: (Leave empty to start a new list)
- Filter to add:
- Attribute:
Category - Operator:
Equal - Value:
Electronics
- Attribute:
- Data format:
- Result:
A new filter list is created, containing one filter:
Category Equal Electronics. This list is now ready to be used in a "Search Data" action.
Example 2: Add another filter to the existing list to include 'Active' status
Continuing from Example 1, you now want to refine your search to only include products that are also "Active".
- Inputs:
- Data format:
Products - List of filters: (The output from Example 1:
[Category Equal Electronics]) - Filter to add:
- Attribute:
Status - Operator:
Equal - Value:
Active
- Attribute:
- Data format:
- Result:
The filter list is updated to include both conditions:
[Category Equal Electronics, Status Equal Active]. This combined list will now find active products in the Electronics category.
Example 3: Create a filter list to find customers with a valid email address
You need to identify all customers who have an email address recorded in your system (i.e., their email field is not empty or null).
- Inputs:
- Data format:
Customers - List of filters: (Leave empty to start a new list)
- Filter to add:
- Attribute:
Email - Operator:
Is not null - Value: (This field is not needed for the "Is not null" operator)
- Attribute:
- Data format:
- Result:
A new filter list is created, containing one filter:
Email Is not null. This list can be used to retrieve all customer records where an email address has been provided.