Query records
task australia Updated Sep 10, 2026 1 min read query-record.md
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.
Shell$ snc record query [--displayvalue displayValue --fields fields --limit limit --offset offset --query query --table table]Pass in values for these arguments.
Parameter Description displayValue Include --displayvalueto 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.
Example
Shell
$ snc record query --displayvalue --fields short_description,state --query '123TEXTQUERY321=email' --table incidentThe CLI returns any records that match the query.
JSON
{ "result": [ { "short_description": "Unable to connect to email", "state": "Closed" } ]}Parent Topic:Perform record operations using ServiceNow CLI
64 lines · 2.1 KB
---
title: Query records
description: Retrieves multiple records from a specified table.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/application-development/servicenow-cli/query-record.html
release: australia
product: ServiceNow CLI
classification: servicenow-cli
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Perform record operations using ServiceNow CLI, ServiceNow CLI, Developing your application, Classic app development, Building applications]
---
# Query records
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
1. 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.
|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.|
## 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"
}
]
}
```
**Parent Topic:**[Perform record operations using ServiceNow CLI](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-cli/manage-records.md)
| title | Query records |
| description | Retrieves multiple records from a specified table. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/application-development/servicenow-cli/query-record.html |
| release | australia |
| product | ServiceNow CLI |
| classification | servicenow-cli |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Perform record operations using ServiceNow CLIServiceNow CLIDeveloping your applicationClassic app developmentBuilding applications |