Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How does table extensions work?

juan9
Giga Guru

I am trying to understand how servicenow table extension works, but I am stuck on how the data is distributed.

 

at first I thought when I extend another table, and I add a record to the child table that it would create a record in both parent and child tables, but thats not the case.

 

case study:

a table (child table) extends another (parent table).

I add a column(c) to the child table.

 

parent table has column a,b

child table has column c

 

when i create a new record in child table with this

a = "a"

b = "b"

c = "c"

 

 

How is that data stored in child table if it does not have columns a and b?

does it create two records, one in each table with the same sys_id?

 

how is the data split?

1 ACCEPTED SOLUTION

Siddhesh Jadhav
Kilo Sage
Kilo Sage

Hi @juan9 ,

 

When a table in ServiceNow is extended, the child table inherits all fields (columns) from the parent table. However, the data is not stored in two separate records; rather, it is stored in a single record with the same sys_id in both the parent and child tables.

 

Here’s how the data is managed:

 

  • The child table inherits the fields a and b from the parent table, so when you create a record in the child table, it will store the values for all fields (a, b, and c) in a single record.
  • ServiceNow stores this record in the child table, but it links to the parent table by using the same sys_id.
  • When you query the parent table, it will return data only from fields a and b. When querying the child table, it will return all fields, including a, b, and c.
  • So, no two records are created. The data from the parent table is accessible to the child table, and both use the same sys_id to connect their data.

 

Thanks & Regards,

Siddhesh Jadhav

 

If this solves your query, please mark it as helpful and accept the solution.

View solution in original post

3 REPLIES 3

juan9
Giga Guru

my best guess for understanding this is that it has two be two records with the same sys_id.
I created a dummy table that extended the task table and ran a query to see if there was a record with the same sys_id and it showed 




I created a record in the child table and it appears as it does create a record in both tables with the same sys_id

Siddhesh Jadhav
Kilo Sage
Kilo Sage

Hi @juan9 ,

 

When a table in ServiceNow is extended, the child table inherits all fields (columns) from the parent table. However, the data is not stored in two separate records; rather, it is stored in a single record with the same sys_id in both the parent and child tables.

 

Here’s how the data is managed:

 

  • The child table inherits the fields a and b from the parent table, so when you create a record in the child table, it will store the values for all fields (a, b, and c) in a single record.
  • ServiceNow stores this record in the child table, but it links to the parent table by using the same sys_id.
  • When you query the parent table, it will return data only from fields a and b. When querying the child table, it will return all fields, including a, b, and c.
  • So, no two records are created. The data from the parent table is accessible to the child table, and both use the same sys_id to connect their data.

 

Thanks & Regards,

Siddhesh Jadhav

 

If this solves your query, please mark it as helpful and accept the solution.