request_table
Fetch records from one ServiceNow table with filters, field selection, and limits; returns a sample and a cache name for reading or exporting the full result.
Instructions
Fetch records from one ServiceNow table. Returns a sample of the records, any warnings and a cache_name; the full result is cached locally for query_cache and export_cache. To join several tables, fetch them with request_tables instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of records to fetch, 100 when omitted. When exactly this many records come back, limit_reached is true and more records probably match: ask again with a higher limit. Above 10000 the request is split into several calls. | |
| query | No | Encoded query passed as sysparm_query, for example active=true^priority=1. Empty returns every record up to the limit. ServiceNow ignores conditions on fields the table does not have and returns the records unfiltered, so use the exact field names, as listed by describe_table: for example business rules in sys_script name their table in collection, not table. | |
| table | Yes | ServiceNow table name, for example incident or sys_user. | |
| fields | No | Field names passed as sysparm_fields. Dot-walking is allowed, for example caller_id.name. Empty returns every field. | |
| refresh | No | Skip the local cache and ask the instance again. Leave false to reuse a recent response. | |
| instance | Yes | Name of a configured instance, as returned by list_instances. | |
| order_by | No | Field name passed as sysparm_order_by. Empty keeps the instance order. | |
| max_records | No | How many of the fetched records to return in this response. The full result stays in the local cache: use query_cache with the returned cache_name to read the rest. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | ||
| table | Yes | ||
| source | Yes | ||
| columns | Yes | ||
| records | Yes | ||
| warnings | Yes | ||
| row_count | Yes | ||
| cache_name | Yes | ||
| elapsed_ms | Yes | ||
| executed_at | Yes | ||
| limit_reached | Yes | ||
| sample_truncated | Yes |