Tables in ServiceNow - Complete Explanation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14m ago - last edited 4m ago
Introduction
Tables are one of the fundamental building blocks of ServiceNow. They are used to store and organize data in the form of rows and columns. In ServiceNow, almost everything we work with, such as Incidents, Problems, Change Requests, Users, and Configuration Items, is stored in tables.
Each table contains records (rows) and fields (columns). For example, the Incident table stores incident details such as Incident Number, Short Description, Priority, State, and Assigned To.
Tables help us manage data efficiently, establish relationships between different records, automate business processes, and generate reports. ServiceNow also supports table inheritance, where child tables can inherit fields from parent tables.
Different Types of Tables in ServiceNow
- Base Tables:
Base tables are the foundation of the table hierarchy. They can store records and act as parent tables for other tables through table inheritance. These tables didn't extend fields these are independent tables.Example: task, cmdb_ci
- Core Tables:
These are pre-built tables provided by ServiceNow to store important data and support different applications and workflows.
Example: Incident, Problem, change_request - System Tables:
System tables are used internally by the ServiceNow platform to manage its configuration, metadata, security, and other platform-related information.
Example: sys_db_object, sys_dictionary - Remote Tables:
Remote Tables allow ServiceNow to access and read data from external systems without storing that data directly in the ServiceNow database.
1. We can only read records from these tables, we cannot insert, update, or delete records.
2. Their names commonly start with the prefix st_, which refers to Scripted Tables.
3. When we create a Remote Table, only the sys_id field is available by default. Other fields need to be defined as required. Custom Tables:
These tables are created by developers to meet specific business requirements when existing ServiceNow tables do not fulfill the requirements. Their names generally start with the prefix u_.By default, when we create a custom table, ServiceNow provides 6 default fields.
The 6 default fields are:
1. sys_created_on – Created
2. sys_created_by – Created By
3. sys_id – Unique ID of the record
4. sys_updated_on – Updated
5. sys_updated_by – Updated By
6. sys_mod_count – Updates
Creating a table in ServiceNow
The sys_db_object table stores information about all tables in ServiceNow. Each table is stored as a record, along with its metadata, such as table name, label, and parent table.
Navigate to All Menu → sys_db_object.LIST or System Definition → Tables.
Click on New.
Enter the Label and Name of the table.
If you want to inherit fields from an existing table, select the required table in the Extends Table field.
Select the required options:
Create Module
Create Mobile Module
Add Module to Menu
New Menu Name
Click on Submit to create the table.
Default System Fields
In ServiceNow, there are 6 system-defined fields that are automatically created when a new table.
The commonly known 6 system fields are:
Sys ID – Unique 32-character identifier for each record.
Created By (sys_created_by) – User who created the record.
Created (sys_created_on) – Date and time when the record was created.
Updated By (sys_updated_by) – User who last updated the record.
Updated (sys_updated_on) – Date and time when the record was last updated.
Updates (sys_mod_count) – Number of times the record has been modified.
Note: If you extend a table from another table, the new table inherits all the fields from its parent table, and only the sys_id field is created specifically for the new table by default. If you create an independent table, ServiceNow provides 6 default system fields: Updated (sys_updated_on), Updated By (sys_updated_by), Updates (sys_mod_count), Created (sys_created_on), Created By (sys_created_by), and Sys ID (sys_id).
Hope you found this article helpful!
Regards,
Tarun