Ask AI
Skip to main content

Search one data record

Function: Search one data record

Search for one particular database item with a set of filters & sorting mechanisms. This action helps you find a single entry in your data based on specific conditions you define, allowing you to retrieve exactly the information you need.

Input

  • Data format (Required, Data Table): The specific data table or type you want to search within. For example, "Customers" or "Products".
  • Filters (Optional, List of Groups): A list of conditions that must all be true for a data record to be found. Each condition is a group of settings:
    • Attribute (Field): The specific field (column) in your data table you want to check.
    • Operator (Dropdown selection): How the attribute should be compared to a value. Options include:
      • Equal: Exactly matches the value.
      • Greater than: Is larger than the value.
      • Greater than or equal: Is larger than or equal to the value.
      • In: Is one of the values in a list.
      • Less than: Is smaller than the value.
      • Less than or equal: Is smaller than or equal to the value.
      • Not equal: Does not match the value.
      • Not in: Is not one of the values in a list.
      • Contains: Includes the specified text (for text fields).
      • Contains \(ignore case\): Includes the specified text, ignoring capitalization.
      • Starts with: Begins with the specified text.
      • Ends with: Ends with the specified text.
      • Is null: The field has no value.
      • Is not null: The field has a value.
    • Value (Any Value): The value to compare against the attribute. This input is hidden if the operator is "Is null" or "Is not null". The type of value you can enter here depends on the type of the selected attribute (e.g., text for a text field, number for a number field).
  • Filters (OR) (Optional, List of Groups): A list of conditions where at least one must be true for a data record to be found. If both "Filters" (AND) and "Filters (OR)" are used, the record must satisfy all AND conditions AND at least one OR condition. Each condition is a group of settings, identical to the "Filters" (AND) section:
    • Attribute (Field): The specific field (column) in your data table you want to check.
    • Operator (Dropdown selection): How the attribute should be compared to a value. (Same options as above).
    • Value (Any Value): The value to compare against the attribute. This input is hidden if the operator is "Is null" or "Is not null".
  • Attributes (Optional, List of Fields): A list of specific fields you want to retrieve from the found data record. If left empty, all fields of the record will be retrieved.
  • Sort by (Optional, List of Groups): A list of rules to determine the order of the search results before picking the first one. Each rule is a group of settings:
    • Attribute (Field): The field by which to sort the results.
    • Order (Dropdown selection): The sorting direction. Options:
      • Ascending: From smallest to largest (A-Z, 0-9).
      • Descending: From largest to smallest (Z-A, 9-0).

Output

  • Found data (Single Data Record): A variable that will store the single data record found based on your search criteria. If no record matches, this variable will be empty. By default, this variable is named FOUND_DATA.

Execution Flow

Real-Life Examples

Example 1: Find a specific customer by email

Goal: Retrieve the customer record for a user with a known email address.

  • Inputs:
    • Data format: Customers
    • Filters:
      • Attribute: Email
      • Operator: Equal
      • Value: john.doe@example.com
    • Found data variable name: CustomerDetails
  • Result: The CustomerDetails variable will contain the full record of the customer whose email is john.doe@example.com.

Example 2: Find the most recently updated active product

Goal: Locate a single product that is currently active and was updated most recently.

  • Inputs:
    • Data format: Products
    • Filters:
      • Attribute: Status
      • Operator: Equal
      • Value: Active
    • Sort by:
      • Attribute: LastUpdatedDate
      • Order: Descending
    • Found data variable name: LatestActiveProduct
  • Result: The LatestActiveProduct variable will hold the record for the active product that has the most recent LastUpdatedDate.

Example 3: Find a user who is either an administrator or a manager, and only retrieve their name and role

Goal: Find a single user record that has either an "Admin" or "Manager" role, and only get their Name and Role fields.

  • Inputs:
    • Data format: Users
    • Filters (OR):
      • Condition 1:
        • Attribute: Role
        • Operator: Equal
        • Value: Admin
      • Condition 2:
        • Attribute: Role
        • Operator: Equal
        • Value: Manager
    • Attributes:
      • Name
      • Role
    • Found data variable name: ImportantUser
  • Result: The ImportantUser variable will contain a record for a user who is either an "Admin" or a "Manager". This record will only include the Name and Role fields.