Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

What is the difference between class and a table?

alaoemmanuel
Mega Contributor

Hi members,

 

I just started learning about ServiceNow. I am using the ServiceNow learning platform. I am confused as to the difference between a table and a class. Does anyone have a perfect analogy or illustration to aid my understanding of the two?

4 REPLIES 4

Tanushree Maiti
Tera Patron

Hi @alaoemmanuel 

 

TanushreeMaiti_1-1789959946024.png

 

"

Answer generated by Now Assist
  • In the context of ServiceNow's Configuration Management Database (CMDB), both "table" and "class" are referenced, particularly when using the CI Class Manager. While the document does not provide explicit definitions, it suggests that a "class" refers to a type or category of Configuration Item (CI) with specific attributes and hierarchy, and a "table" is the underlying data structure that stores records for each class. The CI Class Manager is used to manage both tables and class attributes within the CMDB hierarchy."

 

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

yashkamde
Giga Sage

Hello @alaoemmanuel ,


In short, A table is where records are stored. A class is a definition/type that tells ServiceNow what those records represent and what they inherit.

TableClass
Stores data/recordsDefines the type/category of an object
Like an Excel sheet/database tableLike a blueprint/category
Contains rows (records) and columns (fields)Defines properties, fields, and inheritance
Used to store actual dataUsed to define relationships and common behavior
Example: Incident tableExample: Incident class
A table can extend another tableA class can inherit from a parent class
Example: Task → IncidentExample: Task class → Incident class
Think: Where the data is storedThink: What type of object it is

 

If my response helped mark as helpful and accept the solution.

prerna_sh
Kilo Patron

Hi @alaoemmanuel ,

 

Table = a container for records.
Class = the type of record.

For example:

  • cmdb_ci → CI table
  • cmdb_ci_server → Server class/table
  • cmdb_ci_win_server → Windows Server class/table

So, class tells you what kind of CI it is, while the table is where its data is stored.

 

-------------------------------------------------------------------------------------------------------------------------------------------
If my response solves your query, please mark it as helpful by selecting accept as Solution and Helpful. Let me know if anything else is required.
Thanks,
Prerna

masonreed11
Tera Contributor

Think of a table as a storage box and a class as the type or blueprint for what goes in that box. For example, the Incident table stores incident records, while Incident is also a class that extends the Task class and inherits its fields and behavior. Once you understand inheritance, the relationship between tables and classes in ServiceNow becomes much easier to follow.