You are currently viewing All About ServiceNow Related Lists

All About ServiceNow Related Lists

Hello,

Welcome to ServiceNow Spectaculars.

In this article, we will understand different types of related lists and ways to configure it. It is one of the important features of ServiceNow that helps manage the relationship between tables.

What are related lists?

Related lists are a way to show relationships between one table and another. For example, a user record can have relationships with attachments, incidents, problems, CI, or many other types of tables.

So, all these associated records are listed in a related list and can be displayed at the bottom of the form.

Types of related lists

  • One-to-many related lists
  • many-to-many type related list
  • defined type-related lists.

One-To-Many Related List

  • It is the simplest and most common type of related list.
  • This means you can have many of one kind of record all related to a single record in another table.
  • For example, think of a mango tree where one tree has many mangos connected to it.
  • If we look at it in the database, there would be two tables: one is Tree and the other is Mangos, and one tree can have many mangos, but each mango can have one tree.
  • To accomplish this, the system uses a reference field type from a form to build this relationship.
  • It means there is a field on the Mango table with a reference to the tree table, and based on that field pointing from one table to another, we can imply a one-to-many relationship.

System example of one-to-many

  • A simple example is from the incident table, where we can see a one-to-many relationship between the incident table and the task table, and the reference field here is the parent field.

Many-To-Many Related List

  • A many-To-Many related list allows each record from one object to be linked to multiple records from another object, and vice versa.
  • In the same example of a mango tree, let’s say there are multiple mango trees with lots of mangos on it.
  • There are many workers who are picking mangoes from more than one tree.
  • Hence, it is a many-to-many relationship because many workers are picking many trees.

System example of Many-To-Many

  • These types of related lists are not created automatically
  • They need to be created and configured
  • There are two types of many-to-many in the system
    • sys_m2m, which users can configure
    • sys_collection, which is out of the box, and it is not recommended to make any changes here by users.
  • To see your system’s many-to-many related lists, go to sys_m2m.list,” i.e., the Many to Many Definitions table.
  • The most common example is the user and role table.
  • Here, one user can pick many roles, and one role can be assigned to many users.
  • Finally, we can see this under the sys_user_has_role table.

Defined Related List

  • These related lists have shown based on the conditions
  • For example, attachment related lists
  • You can see a list of all attachments of a particular record in the attachment table.
  • You can see these configured related lists under System Definition->Relationships.

Leave a Reply