How to create relational tables using custom tables and reference fields in ServiceNow?

miyawakiski
Giga Contributor

Hi Community,

I would like to create a set of **relational custom tables** in ServiceNow based on an ER diagram (similar to the one attached).
The structure includes tables like Customer, Order, Product, and Category, with **1-to-N relationships** between them.

I am wondering:

- Which ServiceNow features should I use to model this?
(e.g., Reference fields, Related Lists, Parent-Child tables, Foreign Key constraints, etc.)
- How should I correctly set up **1:N relationships** between tables?
- Are there any best practices for building relational models with **custom tables**?

Any advice, examples, or best practices would be greatly appreciated!

 

I am new to relational table modeling in ServiceNow, so basic guidance would also help.
Thank you!

1 ACCEPTED SOLUTION

Robert H
Mega Sage

Hello @miyawakiski ,

 

Typically you would use a Reference field for 1:N relationships.

 

For example, if my understanding of your Data Model is correct, a "Customer" can have multiple "Orders", and an "Order" has exactly 1 "Customer".

So on your "Order" table you would create a Reference field that references the "Customer" table. That's all you need to do.

 

This will also allow you go to the "Customer" form and see all the "Orders" for this Customer: you would just need to Configure the Related Lists for that form and add the one called "Orders -> Customer" (listed automatically due to the presence of the above Reference field).

 

Regards,

Robert

View solution in original post

2 REPLIES 2

Robert H
Mega Sage

Hello @miyawakiski ,

 

Typically you would use a Reference field for 1:N relationships.

 

For example, if my understanding of your Data Model is correct, a "Customer" can have multiple "Orders", and an "Order" has exactly 1 "Customer".

So on your "Order" table you would create a Reference field that references the "Customer" table. That's all you need to do.

 

This will also allow you go to the "Customer" form and see all the "Orders" for this Customer: you would just need to Configure the Related Lists for that form and add the one called "Orders -> Customer" (listed automatically due to the presence of the above Reference field).

 

Regards,

Robert

miyawakiski
Giga Contributor

Hello @Robert H 

 

Thanks a lot for your clear explanation!
I followed your advice — added the Reference field and configured the Related List — and it worked exactly as I wanted.
Really appreciate your help!

Thanks again!

 

miyawakiski_0-1745898756610.png