describe_table
Retrieve ServiceNow table field definitions, including inherited fields, types, references, overrides, and mandatory/read-only flags, so you can query unknown or custom tables correctly.
Instructions
List the fields of a table from the instance dictionary, including the fields it inherits from the tables it extends, for example task for incident. Each field has its name, label and type, the table that defines it, the table it points to for reference and list fields, and whether it is mandatory or read only. The dictionary overrides of the table and of its parents are applied and listed under overrides. default_value, dependent and choices appear only when the field has them; choices are the active values and labels to use in queries, with the dependent_value of the dependent field when they depend on one. Use it before querying a table whose fields you do not know for sure, custom application tables included. Inactive fields are left out. The returned cache_name holds the tables sys_db_object, sys_dictionary, sys_dictionary_override and sys_choice, where name is the table and element the field.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ServiceNow table name, for example incident or sys_user. | |
| fields | No | Only describe these fields, for example ["state", "caller_id"]. Empty describes every field of the table. | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | ||
| table | Yes | ||
| fields | Yes | ||
| source | Yes | ||
| extends | Yes | ||
| warnings | Yes | ||
| cache_name | Yes | ||
| executed_at | Yes | ||
| field_count | Yes |