Ask AI
Skip to main content

Add a filter to a list of filters

Function: Add a filter to a list of filters

This action allows you to build complex search queries for your data by adding individual filters to a collection. You can start with an empty list or add to an existing one. This is particularly useful when you need to apply multiple conditions to find specific records in your built-in database. If you don't provide an existing list of filters, a new one will be created automatically.

Input

  • Data Format (Type: Data Format)
    • Description: Choose the type of data (e.g., "Customers", "Products", "Orders") that you want to apply filters to. This helps the system understand which fields (attributes) are available for filtering.
  • List of Filters (Type: List of Objects)
    • Description: This is an existing list of filters that you want to add another filter to. If you don't provide one, the system will start with an empty list. Each item in this list is a filter defined by an attribute, an operator, and a value.
    • Required: No
  • Filter (Type: Object)
    • Description: Define the specific filter you want to add. This involves selecting a field (attribute) from your chosen Data Format, an operator (like "Equal to", "Greater than"), and a value to compare against.
      • Attribute: (Type: Data Format Attribute)
        • Description: Select a specific field from your chosen Data Format (e.g., "Customer Name", "Product Price", "Order Date").
      • Operator: (Type: Selection)
        • Description: Choose how the selected attribute should be compared to a value. Options include:
          • Equal: Matches exactly.
          • Greater than: Value is larger.
          • Greater than or equal: Value is larger or the same.
          • In: Attribute's value is one of a list of specified values.
          • Less than: Value is smaller.
          • Less than or equal: Value is smaller or the same.
          • Not equal: Does not match exactly.
          • Not in: Attribute's value is not one of a list of specified values.
          • Contains: Text attribute includes the specified text.
          • Contains \(ignore case\): Text attribute includes the specified text, ignoring capitalization.
          • Starts with: Text attribute begins with the specified text.
          • Ends with: Text attribute ends with the specified text.
          • Is null: Attribute has no value.
          • Is not null: Attribute has a value.
      • Value: (Type: Variable)
        • Description: Provide the value to compare against the attribute. This field will only appear if you select an operator that requires a comparison value (e.g., it will be hidden for "Is null" or "Is not null").

Output

  • Filter list (Type: List of Objects)
    • Description: The updated list of filters, now including the new filter you just added. You can use this list in other actions, for example, to search your database or display filtered data.

Execution Flow

Real-Life Examples

Example 1: Starting a New Filter List for Active Customers

You want to find all "Customers" whose "Status" is "Active".

  • Inputs:
    • Data Format: Customers
    • List of Filters: (Leave empty, or provide a variable that is currently empty)
    • Filter:
      • Attribute: Status
      • Operator: Equal
      • Value: Active
  • Result: A new filter list is created containing one filter: Status Equal Active. This list can then be used in a "Search Data" action to retrieve all active customers.

Example 2: Adding a City Filter to an Existing List

You already have a filter list to find "Active Customers" and now you want to narrow it down further to customers whose "City" is "New York".

  • Inputs:
    • Data Format: Customers
    • List of Filters: myExistingCustomerFilters (a variable holding [ \{ Attribute: Status, Operator: Equal, Value: Active \} ])
    • Filter:
      • Attribute: City
      • Operator: Equal
      • Value: New York
  • Result: The myExistingCustomerFilters variable is updated to include two filters: Status Equal Active AND City Equal New York. This combined list will now find active customers located in New York.

Example 3: Filtering Products by Name and Price

You want to find "Products" whose "Name" contains "Pro" and whose "Price" is greater than 50.

  • Inputs:
    • Data Format: Products
    • List of Filters: myProductFilters (a variable holding [ \{ Attribute: Price, Operator: Greater than, Value: 50 \} ])
    • Filter:
      • Attribute: Name
      • Operator: Contains
      • Value: Pro
  • Result: The myProductFilters variable is updated to include two filters: Price Greater than 50 AND Name Contains Pro. This list can be used to search for products matching both conditions.