O'Reilly logo

Mastering ServiceNow by Martin Wood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Many-to-many relationships

The other type of relationship between records is many-to-many. The relationship between siblings is many-to-many. I can have many brothers and sisters, as can they. But how can I store this? A reference field can only point to one record. Adding a lot of reference fields into a form is one way. Each reference field could point to another sibling. However, that's not great design. What if there were five populated reference fields and another brother or sister was born?

Instead, we could create another table that sits in between each target, acting as the "glue" that sticks the two together. A special many-to-many table can then have two reference fields, each pointing to a different side.

In the Hotel application, we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required