Schema Design Patterns
Good schema design prevents technical debt. Learn when to extend vs. create tables, how scoped apps isolate data, when table-per-type is better than a single table, and the patterns ServiceNow itself uses for configuration and lookup data.
Extend vs. New Table — The Decision Framework
Every new data requirement in ServiceNow starts with the same question: should I extend an existing table, or create a new standalone one? Getting this wrong creates long-term pain — missed framework features if you don't extend when you should, or an overly complex hierarchy if you extend when you shouldn't.
Ask these questions in order:
- Does this represent work that people do? (tickets, tasks, approvals) → Extend
task - Does this represent a physical or logical thing in IT? (server, app, service) → Extend
cmdb_ci - Does this extend a more specific existing type? (a kind of incident, a kind of server) → Extend that type's table
- Is this purely reference/lookup data? (categories, locations, vendors) → Standalone table
- Is this configuration data for your app? (settings, rules, policies) → Standalone table
incident
to create a new "Facility Request" just because you want the state field, you now have
Facility Requests appearing in all Incident reports and SLA rules. Only extend a table when
your new record type is genuinely a specialization of the parent type.
Scoped Applications and Table Isolation
A Scoped Application is a container for all the components (tables, scripts, UI, workflows) that belong to a specific application. Every table, script, and configuration item created within a scope belongs to that scope and is isolated from other scopes by default.
Think of scopes as namespaces: they prevent name collisions and ensure that changes in one application don't accidentally break another. A scoped app with vendor prefix x_acme creates tables like x_acme_project and x_acme_deliverable. No other app can accidentally create a table with those same names.
Global vs. Scoped
| Aspect | Global Scope | Scoped Application |
|---|---|---|
| Table naming | Must start with u_ | Uses app namespace prefix (x_vendor_) |
| Script access | Can access all tables/scripts | Restricted by cross-scope access policies |
| Upgrade safety | May conflict with upgrades | Isolated — upgrades don't touch scoped code |
| Store publication | Cannot publish to Store | Can be published to ServiceNow Store |
| Best for | Instance-specific customizations | Reusable apps, products, integrations |
Configuration Tables Pattern
One of the most common patterns in ServiceNow development is the Configuration Table pattern. Instead of hard-coding rules or values in scripts, you store them in a configurable table. This separates "what the app does" (code) from "how it is configured" (data), making the system more maintainable and giving admins control without needing developer access.
For example, instead of writing a Business Rule that has a hard-coded list of assignment groups for each category, you create a table u_routing_rule with fields for Category and Assignment Group. The Business Rule then queries this table. Now admins can add, remove, or change routing rules by editing table records — no script changes needed.
sys_properties) follow this same pattern.
Rather than hard-coding values in scripts, the platform stores configuration values as records
in sys_properties. Your custom apps should follow the same convention —
use gs.getProperty('your.property.name') to retrieve configuration values.
Lookup / Reference Data Tables
Lookup tables (sometimes called "reference data tables") are standalone tables that exist purely to provide values that other tables reference. They typically have just a Name field and a few descriptive fields. Examples: countries, languages, product lines, priority levels, or service categories.
The advantage over Choice fields: lookup table values can be edited by administrators without touching the data dictionary. Adding a new choice to a dropdown field requires a developer with dictionary access. Adding a new row to a lookup table is a simple form save that any admin can do.
| Aspect | Choice Field | Lookup Table + Reference |
|---|---|---|
| Adding new values | Requires dictionary edit (developer) | Add row to table (admin) |
| Additional metadata | Label/value only | Can add as many fields as needed |
| Referential integrity | None — choice deleted = orphaned data | Reference link — can detect/prevent orphans |
| Cross-table use | Defined per-field, per-table | Same lookup table referenced from many tables |
| Suitable for | Small, stable sets (5-15 values) | Larger, growing, or metadata-rich sets |
Schema Upgrade Safety
ServiceNow upgrades (new platform releases) update baseline records — Business Rules, ACLs, Dictionary entries, and Scripts that ship with the platform. Understanding which customizations are upgrade-safe is essential for maintaining a healthy instance.
- Custom fields (u_ prefix) — 100% upgrade safe. Upgrades never modify custom-prefixed fields.
- New custom tables — 100% upgrade safe. Upgrades never delete custom tables.
- New business rules / scripts — Safe if the name doesn't conflict with a baseline record being added.
- Modifications to baseline records — Flagged as "customer modified." The upgrade may skip re-applying the ServiceNow change, leaving you running old logic.
- Dictionary modifications on baseline fields — Risky. If ServiceNow changes the baseline definition, your change may be overwritten or cause conflicts.
Common Exam Traps — Schema Design
- Extend
taskwhen building "work items" — standalone tables lose SLAs, approvals, activity stream - Extend
cmdb_ci(or its children) for any CI type you need to track - Scoped app tables use
x_vendor_prefix; Global custom tables useu_ - Scoped scripts cannot access Global tables without explicit Cross-Scope Access grants
- Configuration Tables (storing rules as records) are preferred over hard-coded values in scripts
- Lookup/reference tables scale better than choice fields when values change frequently or carry metadata
- Modifying baseline records risks missing upgrade patches — create new records alongside instead
- Custom fields with u_ prefix are never touched by platform upgrades
Practice Questions
4 questions · Select an answer to see the explanation immediately.
A scoped application needs to store IT asset records. Which table should its custom CI table extend to ensure proper CMDB integration?
C is correct. Any CI type should extend cmdb_ci or one of its subclasses to participate in CMDB Health, IRE, and Discovery. task is for work items. sys_metadata is for platform metadata. A standalone table would be disconnected from all CMDB tooling.