Look Up Records action

  • Release version: Zurich
  • Updated July 31, 2025
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Look Up Records action

    The Look Up Records action in ServiceNow's Workflow Studio enables you to retrieve multiple records from any table by specifying search conditions. It is designed to be used within flows, allowing users with theflowdesigneroradminroles to add this action and configure it dynamically.

    Show full answer Show less

    Key Features

    • Input Parameters:
      • Table: Specify the table name from which to look up records.
      • Conditions: Define field names and values to filter the search. Inline scripting using GlideRecord or GlideQueryCondition can be used for advanced queries.
      • Order by: Select a field to sort the results.
      • Sort Type: Choose ascending or descending alphabetical order.
      • Max Results: Limit the number of returned records to improve performance.
    • Outputs:
      • Records: List of Sys IDs of matched records, usable as input in other flow actions.
      • Table: The table name containing the returned records.
      • Count: Number of records retrieved.

    Best Practices

    • Use For Each flow logic: To process individual records from the list returned by this action, incorporate For Each logic in your flow.
    • Limit Max Results: Set Max Results to 1000 or fewer to optimize flow performance and reduce resource consumption.
    • Filter with precise conditions: The more specific your conditions, the faster and more efficient the lookup will be.

    Practical Example

    For instance, a flow triggered by an emergency change request in the Network category can use this action to look up configuration items (from the cmdbci table) assigned to the requester. By setting the Order by field to Name with ascending sort, the action returns a list of configuration items sorted alphabetically, along with the count of matched records. The output Records data pill contains the Sys IDs, allowing further flow actions to utilize these records.

    Look up multiple records on any table using defined conditions.

    Roles and availability

    Available as a Workflow Studio ServiceNow core action. Users with the flow_designer or admin role can add an action to a flow and define configuration details.

    Inputs

    Provide a value for each input that your flow needs. To add dynamic values, you can also drag pills from the Data panel or select them from the pill picker.

    Table
    Data type: Table Name

    Table name containing the records you want to look up.

    Conditions
    Data type: Conditions

    Field names and field values that you want to use to search for records. To use an inline script to specify conditions, consider using the GlideRecord and GlideQueryCondition classes to build your query. See GlideRecord - Global and GlideQueryCondition - Global.

    Order by
    Data type: Field Name

    Field you want to use to sort results.

    Sort Type
    Data type: Choice

    Option to sort alphabetically in ascending or descending order.

    Max Results
    Data type: Integer

    The maximum number of record results the action can return.

    Outputs

    These outputs appear in the Data panel. You can use them as inputs elsewhere in your flow.

    Records
    Data type: Records

    List of record Sys IDs found based on the lookup criteria that you provided. For more information, see Records.[Table] data type.

    Table
    Data type: Table Name

    Table that contains the list of records.

    Count
    Data type: Integer

    Number of records that the action returned.

    General guidelines

    Use these general guidelines when working with the Look Up Records action.

    Process records with For Each flow logic
    Use For Each flow logic to iterate through a list of records. For more information about using For Each flow logic, see For Each flow logic.
    Set Max Results to improve performance
    Set the Max Results input to 1000 records or lower to improve the performance of your flow. The more records that the system has to look up, the more system resources it takes to identify and process them.
    Use conditions to filter records
    Use conditions to limit the number of records the action returns. The more specific conditions that you can provide, the better performance your flow has.

    Look up configuration items assigned to a change request user

    Configuration of Look Up Records action

    In this example, the flow starts when an emergency change request is opened in the Network category. The Look Up Records action uses the Configuration Item [cmdb_ci] table as the Table input. The Conditions input looks for configuration items assigned to the requester of the change request. The Order by input uses the Name field to perform an ascending alphabetical type sort.

    Execution details of Look Up Records action

    In the execution details, the Count output shows three configuration items that are assigned to the requester of the change request. The Records output shows the configuration items by name in the execution details page, but the data pill contains a series of Sys ID values. The Table output is the Configuration Item [cmdb_ci] table.