Difference Between Relationship and Reference in a table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 09:32 AM
Hi,
What is the difference between Relationship and Reference. Generally I created two tables 1. Fno request info and 2. Fne compliance.
so in fne compliance table I created a reference field which refers to Fno request info table, and in Fno request info table > configure > related lists > Fne compliance. that appears a table on Fno request info form,
Then I created relationship between them and I see in related lists the option which does the same as reference field creation on fno request info table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 10:01 AM
Hi @Adil a
What is the difference between Relationship
Atul: When we extend any table from other table or any record has parent of the other table .
Like Parent - child (cmdb_ci --> cmdb_ci_computers)
It can be 1-1 / 1- M relationship.
and Reference.
Atul: When we use a field of another table then it is refernece
Like
On incident table - caller field that is reference to user table.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 10:06 AM
Adding a Reference field on table A that points to table B , creates a relationship that ServiceNow can understand. This allows you to add a related list on records in table B , that displays the records from table A that are linked to it.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 10:07 AM
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 10:10 AM
Hi @Adil a ,
1. Reference Field:
- A reference field in ServiceNow is a field type that establishes a one-to-one relationship between records in different tables. It typically stores the Sys ID of the referenced record.
- When you create a reference field in a table (e.g., Fne compliance table) that refers to another table (e.g., Fno request info table), it allows you to link records in the Fne compliance table to specific records in the Fno request info table.
- For example, in your scenario, you created a reference field in the Fne compliance table that refers to the Fno request info table, allowing you to link compliance records to specific request info records.
2. Relationship:
- A relationship in ServiceNow defines a logical connection between tables based on shared fields or criteria. It allows you to define how records in one table are related to records in another table.
- When you create a relationship between tables, you're establishing a connection that ServiceNow can use to display related records or perform operations across tables.
- For example, you can create a relationship between the Fno request info table and the Fne compliance table to indicate that request info records are related to compliance records. This allows you to easily view related compliance records from the request info form and vice versa.
In summary, a reference field is a specific type of field that establishes a direct link between individual records, while a relationship defines a broader connection between entire tables. Both can be useful depending on your specific requirements for data organization and access. In your scenario, both the reference field and the relationship serve similar purposes of linking records between the Fne compliance and Fno request info tables, but they may offer different capabilities or functionalities depending on how they are configured.
Thanks,
Danish