Look Up Record step

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 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 Record step

    The Look Up Record step in ServiceNow allows users to retrieve records from any table based on specified conditions. It is available as an Action Designer action step, enabling users with the actiondesigner role to create custom actions with multiple steps.

    Show full answer Show less

    Key Features

    • Table Selection: Choose a table from the available list.
    • Condition Definition: Set static or dynamic conditions using the condition builder or by defining input data pills for dynamic conditions.
    • Order By: Determine the sorting method for results when multiple records match the conditions.
    • Sort Type: Select alphabetical sorting in ascending or descending order.
    • Multiple Records Handling: Options include returning only the first record or failing the step.
    • Fail on Error Options: Decide whether to halt the flow if no record is found.

    Key Outcomes

    Outputs from this step include:

    • Record: The record matching the defined conditions.
    • Table: The name of the table associated with the returned record.
    • Status: Indicates if a record was found (1) or if there was an error (0).
    • Error Message: Provides details if a record could not be found (populated only if the Status is 0).
    • Action Error Evaluation: Determines if the flow should continue or evaluate errors based on the step's status code or message.

    Look up a record from any table based on defined conditions.

    Roles and availability

    Available as an Action Designer action step. Users with the action_designer role can create a custom action with one or more action steps.

    Fields

    Field Description
    Table Select a table from the list.
    Conditions

    Set static or dynamic conditions to filter records. To define a static condition applied each time the action runs, define the conditions with the condition builder. To enable flow designers to dynamically apply conditions, define an input of type Conditions and drag-and-drop the input data pill into the Conditions field.

    When building a condition that looks up the value of a reference field, use a data pill that explicitly provides the Sys ID value. Ensure the condition has the format [reference field][is][Reference type data pill->Sys ID]. For example, both the Change and Incident tables contain a reference field to the User table. To look up change records where the requester is the caller from an incident record, create the condition [Requested by][is][Trigger->incident record->Caller->Sys ID]. [Requested by][is][action->incident->Caller->Sys ID] where incident is an input variable for an incident record.

    Order by Determines how to sort results when more than one record matches the defined conditions. Select the field you want to use to sort results.
    Sort Type Select whether to sort alphabetically in ascending or descending order.
    If multiple records are found Determines what is returned if more than one record matches the defined conditions.
    • Return only the first record
    • Fail the step
    Don't fail on error Determines whether to fail the flow if a record can't be found.

    Outputs

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

    Record
    Data type: Record

    Record found based on the conditions you specified in the Conditions input.

    Table
    Data type: Table

    Name of the table associated with the returned record.

    Status
    Data type: Choice

    1 if a record was found successfully, and 0 if there was an error.

    Error Message
    Data type: String

    Message containing details about why the record could not be found.

    Note:
    This output's value is only populated if the Status output's value is 0.

    Action error evaluation

    If this step fails
    Data type: Choice

    Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see Action error evaluation.

    Example

    Example Look Up Record step in an action.