Ask AI
Skip to main content

Find a first match in a list

Function: Find a first match in a list

This action helps you efficiently search through a collection of items (like a list of products, users, or tasks) and retrieve the very first item that meets specific criteria you define. It's like asking the platform, "Show me the first item in this list that looks like X."

Input

  • List
    • Description: The collection of items you want to search through. This could be a list of customer records, product details, or any other structured data.
    • Type: A list of values.
  • Filters
    • Description: These are the rules you set to specify what kind of item you are looking for. You can add one or more filter rules to narrow down your search.
    • Type: A list of values, where each value is a filter rule.
    • Each filter rule consists of:
      • Attribute
        • Description: The specific field or property within each item in your list that you want to check (e.g., "Product Name", "User Status", "Order Date").
        • Type: A single attribute of a data structure.
      • Operator
        • Description: How the Attribute should be compared to the Value. You select this from a dropdown list.
        • Type: A selection from a dropdown.
        • Available Options:
          • Equal: The attribute must be exactly the same as the value.
          • Greater than: The attribute's value must be numerically or chronologically larger than the specified value.
          • Greater than or equal: The attribute's value must be numerically or chronologically larger than or equal to the specified value.
          • In: The attribute's value must be present within a list of specified values.
          • Less than: The attribute's value must be numerically or chronologically smaller than the specified value.
          • Less than or equal: The attribute's value must be numerically or chronologically smaller than or equal to the specified value.
          • Not equal: The attribute must not be the same as the value.
          • Not in: The attribute's value must not be present within a list of specified values.
          • Contains: The attribute's text value must include the specified text.
          • Contains (ignore case): The attribute's text value must include the specified text, without regard to capitalization.
          • Starts with: The attribute's text value must begin with the specified text.
          • Ends with: The attribute's text value must end with the specified text.
      • Value
        • Description: The specific data you want to compare against the Attribute using the chosen Operator.
        • Type: Any type of data (text, number, date, etc.).

Output

  • Result
    • Description: The variable where the first item from your List that matches all your Filters will be stored. If no item in the list satisfies all the filter conditions, this variable will remain empty.
    • Type: A collection of key/value pairs combined in an object.
    • Default Value: FOUND_MATCH

Execution Flow

Real-Life Examples

Example 1: Find a specific product by its unique ID

Imagine you have a list of all your products and you need to quickly find the details of a product using its unique identifier.

  • Inputs:
    • List: [ \{ "ProductID": "P101", "Name": "Laptop", "Price": 1200 \}, \{ "ProductID": "P102", "Name": "Mouse", "Price": 25 \}, \{ "ProductID": "P103", "Name": "Keyboard", "Price": 75 \} ]
    • Filters:
      • Attribute: ProductID
      • Operator: Equal
      • Value: P102
  • Result: The variable FOUND_MATCH will contain the object: \{ "ProductID": "P102", "Name": "Mouse", "Price": 25 \}.

Example 2: Find the first available meeting room

You have a list of meeting rooms, and you want to find the first one that is currently marked as "Available" and has a capacity of at least 10 people.

  • Inputs:
    • List: [ \{ "RoomName": "Alpha", "Status": "Booked", "Capacity": 8 \}, \{ "RoomName": "Beta", "Status": "Available", "Capacity": 12 \}, \{ "RoomName": "Gamma", "Status": "Available", "Capacity": 6 \} ]
    • Filters:
      • Filter 1:
        • Attribute: Status
        • Operator: Equal
        • Value: Available
      • Filter 2:
        • Attribute: Capacity
        • Operator: Greater than or equal
        • Value: 10
  • Result: The variable FOUND_MATCH will contain the object: \{ "RoomName": "Beta", "Status": "Available", "Capacity": 12 \}.

Example 3: Locate a customer whose email address contains a specific domain

You have a list of customer records and need to find the first customer whose email address belongs to a specific company domain, regardless of capitalization.

  • Inputs:
  • Result: The variable FOUND_MATCH will contain the object: \{ "Name": "Bob", "Email": "[email protected]" \}.