---
sourceDocument: Yokohama Build or modify applications
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/application-development

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Query records

# Query records {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Retrieves multiple records from a specified table.

## Before you begin

Role required: sn_cli_metadata.cli_admin, sn_cli_metadata.cli_user, or admin

## Procedure

Open your system's command-line tool and execute this command.  

    $ snc record query [--displayvalue displayValue --fields fields --limit limit --offset offset --query query --table table]

Pass in values for these arguments.  
{#query-record__id_b5x_qyf_m4b__entry__2}

| Parameter | Description |
|-|-|
| displayValue | Include `--displayvalue` to retrieve the display value from the database for reference and choice fields. Do not include this parameter to retrieve the actual values. |
| fields | Comma-separated list of field names to return from the database. |
| limit | Maximum number of records to return. |
| offset | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. |
| query | Required. Encoded query used to filter the result set in the following format: `--query '<column_name><operator><value>'`. |
| table | Required. Name of the table in which to query the records. |
[ ]

{#query-record__id_b5x_qyf_m4b}

## Example

    $ snc record query --displayvalue --fields short_description,state --query '123TEXTQUERY321=email' --table incident

The CLI returns any records that match the query.  

    {
       "result": [
          {
             "short_description": "Unable to connect to email",
             "state": "Closed"
          }
       ]
    }


