Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 39 ยท Tables and Data Model

Table Extension and the Task Table

Learn table extension (inheritance) in ServiceNow, why incident, problem and change extend task, how sys_class_name works, and when to extend or stay standalone.

ServiceNow tables can extend other tables, much like a subclass inherits from a class. A child table gets every column of its parent and can add its own. This is how the platform shares behavior across Incident, Problem, Change and dozens of other record types, and it is one of the most important ideas in the data model.

The idea

When table B extends table A:

  • B has all of A's columns plus its own.
  • Business rules, ACLs, client scripts and UI policies defined on A also apply to B (unless a rule is limited to the exact table).
  • Records of B are also visible when you list A. Listing task shows incidents, problems, changes and more in one list.
  • A hidden column sys_class_name on each row says which table the record really belongs to.
flowchart TD
  T["task"] --> I["incident"]
  T --> P["problem"]
  T --> C["change_request"]
  T --> S["sc_task"]
  T --> R["sc_req_item"]

Some tables that extend task.

The task table

task holds what any "piece of work" needs: number, short_description, description, state, priority, assigned_to, assignment_group, opened_by, opened_at, closed_at, active, work_notes, comments, and more. Tables that extend task inherit all of this, so they share the same assignment logic, SLA engine, approvals and activity stream.

That reuse explains why many applications feel familiar: the Number column, the State choice list and the assignment fields work the same everywhere.

Table Extends Number prefix (default)
incident task INC
problem task PRB
change_request task CHG
sc_request task REQ
sc_req_item task RITM
sc_task task SCTASK

sys_class_name

A row in incident has sys_class_name = incident. If you list the parent task table and open that row you will be taken to the incident form. The class column also lets you filter a task list by type (Task type in the list).

Python Extension and inherited columns (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Extending a table yourself

When you create a table (System Definition > Tables > New), set Extends table. Good reasons:

  • Your records are real tasks (a "Facilities Request") and should get assignment, SLAs, approvals and the activity stream. Extend task.
  • Your records are configuration items (an "Industrial Robot") and belong in the CMDB. Extend cmdb_ci or a more specific class.
  • You need a specialized version of an existing table (a table for VIP incidents). Think twice: a field or a category is often enough.

Reasons not to extend: your data is just a lookup list (a vendor type, a cost center). Use a standalone table, which is simpler, faster and free of inherited rules.

Also decide whether the parent Extensible flag is set; you can only extend a table marked extensible. Once you choose a parent you cannot change it later without recreating the table, so pick carefully.

How an extension hierarchy is stored physically is a platform internal, and it can affect performance on very large tables. For a big table, discuss the design with a platform architect before extending.

Practical effects

  • A business rule on task runs for incidents, problems and changes. Limit it with a condition on Table/current.sys_class_name if you only want one.
  • A UI policy on incident does not run for problem.
  • A new field on task appears on every child form's available fields, but you must add it to each form layout.
  • Reports on task can count work across all child tables, a powerful way to show "everything assigned to my group".
Python Counting work across the hierarchy (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a child table inherit from its parent?

    A child has the parent's columns and, normally, the rules defined on the parent.
  2. 2. Which table do incident, problem and change_request extend?

    They all extend task, which supplies number, state, assignment and more.
  3. 3. What does sys_class_name tell you?

    It names the real table of the row, such as incident when you list task.
  4. 4. When should you NOT extend task?

    A simple lookup list is better as a standalone table without inherited behavior.

Summary

  • Extension lets a child table inherit a parent's columns and rules.
  • task is the parent of incident, problem, change and request tables.
  • sys_class_name identifies the real table of each row.
  • Extend task for real work items; keep lookup tables standalone.

Next: Reference Fields and Dot-Walking