Query ServiceNow Table
query_tableQuery ServiceNow tables using encoded queries, field selection, and display values. Retrieve records from any table like incident or user.
Instructions
Query any ServiceNow table using the Table API. Returns records matching the specified criteria. Supports encoded query strings, field selection, and display value resolution.
Use this for general-purpose data retrieval from any table (incident, sys_user, cmdb_ci, change_request, etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance | No | The ServiceNow instance auth alias (e.g., "myinstance", "prod"). If not provided, falls back to the SN_AUTH_ALIAS environment variable. | |
| table | Yes | The ServiceNow table name to query (e.g., "incident", "sys_user", "cmdb_ci_server"). This is the internal table name, not the label. | |
| query | No | A ServiceNow encoded query string to filter records. Examples: "active=true^priority=1", "short_descriptionLIKEnetwork^state!=7", "sys_created_on>javascript:gs.daysAgoStart(7)". If omitted, returns all records up to the limit. | |
| fields | No | Comma-separated list of field names to return (e.g., "sys_id,number,short_description,state"). If omitted, all fields are returned. Specifying fields improves performance and readability. | |
| limit | No | Maximum number of records to return. Default is 20, max is 1000. | |
| display_value | No | When true, returns display values instead of internal values for reference and choice fields. For example, assignment_group returns the group name instead of the sys_id. |