Build the data model
Summarize
Summary of Build the data model
This content guides ServiceNow customers on creating tables and fields to build an application’s data model effectively. It emphasizes leveraging ServiceNow’s built-in features such as automatic field additions, table extensions, and appropriate field types to ensure consistent and manageable data within their instances.
Show less
Key Features
- Automatic Fields: Every new table automatically includes five system fields—Created by, Created, Updated by, Sys ID, and Updates—that track record metadata for management and auditing.
- Table Extensions: New tables can extend existing ones (commonly the task table) to inherit fields and functionality, reducing redundancy and improving data model consistency.
- Field Types: A wide variety of field types are available to suit data needs, including Integer, Currency, Phone number, Reference, Choice, Date, Date/Time, and String. Choosing the correct type is critical for validation, data integrity, and usability.
- Reference Fields vs. Choice Lists:
- Reference fields link to existing tables, normalizing data and providing access to related information (e.g., referencing a User table for Caller fields).
- Choice lists are simpler name/value pairs suitable for fields with ten or fewer static options.
- Data Consistency Best Practices: Avoid using freeform String fields for key entities like users; instead, use Reference fields to ensure consistent data selection across records.
- Field Reuse and Overrides: Before creating new fields on extended tables, customers should check for existing inherited fields to avoid duplication and instead override labels if necessary.
Practical Guidance for ServiceNow Customers
- Leverage automatic system fields for auditing and tracking without manual setup.
- Use table extensions thoughtfully to inherit functionality and reduce complexity.
- Select field types carefully to enforce data integrity and ease of use; prefer Reference fields over String fields for relational data.
- Use Choice lists only for small, static sets of options; use Reference fields when options are many, dynamic, or managed by non-admin users.
- Review existing tables and fields before creating new ones to avoid redundancy and maintain a clean data model.
- Consider ServiceNow’s agentic AI capabilities to assist in application creation.
Create tables and fields on the tables to support the application’s data model.
ServiceNow automatically adds five fields to each new table. The new fields contain auto-populated information about the table.
| Field name | Database name | Description |
|---|---|---|
| Created by | sys_created_by | User who created the record. |
| Created | sys_created_on | Date/time when the record was created. |
| Updated by | sys_updated_by | User who last updated the record. |
| Sys ID | sys_id | Unique identifier for the record. It is unique throughout the instance. |
| Updates | sys_mod_count | Numeric field that counts the number of updates to the record since record creation. |
New tables can extend an existing table to inherit fields and functionality from the table being extended. Add to and modify the components of the extended table. The most commonly extended ServiceNow table is the task table. For more information, see When to create a new table vs. when to extend and Exploring ServiceNow AI Platform® tables.
In the example, a string field type is used for a user's name. Notice the Caller field is different for each Incident record, but the caller may be the same person. Do not use a string field type for a user's name in tables.
Instead, use a reference field type that references the User table instead of a String field. Users then need to select a single consistent record in the Caller field.
Reference fields ensure consistent data by normalizing date in another table in ServiceNow. ServiceNow has over 2000 baseline tables available to reference. The Appendix lists some commonly used tables for building an app.
| Field type | Descriptions |
|---|---|
| Integer | Stores number values and can be used in calculations. |
| Currency | Holds a currency value and will show values in the currency of the logged in user. |
| Phone number | Includes validation and formatting for E164-compliant phone numbers. |
| Reference | Displays a record from another table and helps to normalize data. |
| Choice | Displays a select box with a predefined list of choices. Choice lists should include fewer than ten items. |
| Date | Stores a date value selected with a date picker. Use Date if you do not need a specific time. |
| Date/Time | Stores date and time values selected with a date and time picker. Use Date/Time to compare specific times or if the exact time is important. |
| String | Holds freeform text. Use String if no other field type matches the values stored in the field. |
Choice lists or reference fields
Choice lists and Reference fields both offer users a way to choose a value from a list. Choice lists are name/value pairs. Users select from the names and the field stores the value of the selected choice. Scripts use the value. Add and remove name/value pairs from the choices to manage the list of options.
Reference fields point to a table. Manage choices in the table. The value stored in the reference field is the sys_id of the referenced record.
- The field requires more than ten choices.
- The choices will regularly change.
- Someone other than an administrator needs to manage the choices.
- The value of the field has an impact on decision logic. For example, decision tables in Flow Designer.
- The data has multi-level dependencies between different fields that can lead to complex and unwieldy choice field combinations.
- The choices require more than a name/value pair. For example, referencing a user record gives the referencing table access to other user details, such as email and department.
- A table already exists that includes the data needed for the field.