{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4254,"path":"build-workflows/workflow-studio/lookup-records-flow-designer.md","title":"Look Up Records action","bundle":null,"doc_type":null,"release":"australia","body":"\n# Look Up Records action\n\nLook up multiple records on any table using defined conditions.\n\n## Roles and availability\n\nAvailable 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.\n\n## Inputs\n\nProvide 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.\n\n-   **Table**\n\n    Data type: **Table Name**\n\n    Table name containing the records you want to look up.\n\n-   **Conditions**\n\n    Data type: **Conditions**\n\n    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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/c_GlideRecordAPI.md) and [GlideQueryCondition - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/c_GlideQueryConditionAPI.md).\n\n-   **Order by**\n\n    Data type: **Field Name**\n\n    Field you want to use to sort results.\n\n-   **Sort Type**\n\n    Data type: **Choice**\n\n    Option to sort alphabetically in ascending or descending order.\n\n-   **Max Results**\n\n    Data type: **Integer**\n\n    The maximum number of record results the action can return.\n\n\n## Outputs\n\nThese outputs appear in the Data panel. You can use them as inputs elsewhere in your flow.\n\n-   **Records**\n\n    Data type: **Records**\n\n    List of record Sys IDs found based on the lookup criteria that you provided. For more information, see [Records.\\[Table\\] data type](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/records-data.md).\n\n-   **Table**\n\n    Data type: **Table Name**\n\n    Table that contains the list of records.\n\n-   **Count**\n\n    Data type: **Integer**\n\n    Number of records that the action returned.\n\n\n## General guidelines\n\nUse these general guidelines when working with the Look Up Records action.\n\n-   **Process records with For Each flow logic**\n\n    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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/flow-logic-for-each.md).\n\n-   **Set Max Results to improve performance**\n\n    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.\n\n-   **Use conditions to filter records**\n\n    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.\n\n\n## Look up configuration items assigned to a change request user\n\n\\[Omitted image \"example-look-up-records-action.png\"\\] Alt text: Configuration of Look Up Records action\n\nIn 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.\n\n\\[Omitted image \"example-look-up-records-action-execution-details.png\"\\] Alt text: Execution details of Look Up Records action\n\nIn 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.\n\n**Parent Topic:**[Workflow Studio actions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/flow-actions.md)\n\n"}}