Why Is the number Column Missing From the INCIDENT Table?
Question
Why is the number column missing from the INCIDENT table?
Environment
Connector: ServiceNow
Answer
The ServiceNow connector uses table inheritance, and INCIDENT is a child of TASK. By default, we sync inherited columns only to the parent table rather than duplicating them in each child table. As a result, inherited columns, such as number and short_description, are in the TASK table.
To retrieve the incident number, join incident.sys_id to task.sys_id:
SELECT
i.sys_id,
t.number AS incident_number,
i.category,
i.sub_category
FROM incident i
LEFT JOIN task t
ON i.sys_id = t.sys_id
LIMIT 100;
If you enabled Include inherited columns while setting up your connection, the number column appears directly in the INCIDENT table.
For more information, see Syncing columns from parent tables to child tables and Why Can't I Enable or Edit the Inherit Column Feature in My ServiceNow Connection?.