Query ServiceNow Table
query_tableQuery any ServiceNow table to retrieve records matching specified criteria. Supports encoded query strings, field selection, and display value resolution for general-purpose data retrieval.
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 |
|---|---|---|---|
| limit | No | Maximum number of records to return. Default is 20, max is 1000. | |
| 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. | |
| 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. | |
| 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. | |
| instance | No | The ServiceNow instance auth alias (e.g., "myinstance", "prod"). If not provided, falls back to the SN_AUTH_ALIAS environment variable. | |
| 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. |