Unify Logo Footer.svg
Platform Tools
Logo
Relationships between objects

Relationships between objects

Logo

4 mins READ

Linking records in one object to records in another.

Overview

You link objects with a lookup field. On the object that should point at another, add a Single Select Dropdown (one link) or Multi Select Dropdown (many links) field and set its Dropdown Value Type to Lookup. Then choose the object to look up. Now each record can reference one (or several) records in that other object — for example an Order object with a lookup to a Customer object means every order points to its customer. The lookup shows the referenced record by its Display Name, not its raw ID, so the link reads clearly. You can optionally enforce a foreign-key constraint (below) so only real records can be chosen.

Where: Object › Schema, lookup field

relation-1 1.png
relation-1 1.png

Types of relationships

Relationships come in four shapes, based on how many records can link on each side:

  • One to one — each record here links to exactly one record there, and vice versa.

  • One to many — one record here links to many records there (one Customer has many Orders).

  • Many to one — many records here link to one record there (many Orders belong to one Customer).

  • Many to many — records on both sides can link to many on the other (Students and Courses).

Which shape you get follows from the lookup: a single-select lookup gives a "to-one" link from this side; a multi-select lookup gives a "to-many" link. Reading the relationship from the other object's side flips it (a Customer's view of Orders is one-to-many).

Where: Object schema, relationship type

Foreign-key constraint and should I enforce it

When a lookup field uses the Lookup value type, you can turn on Enforce Foreign Key Constraint. With it on, a record can only store a reference to a record that actually exists in the linked object — if the target is missing, saving that record is rejected with an error. With it off, the field can hold a reference that may not resolve to a real record. Enforce it when referential integrity matters (you never want an Order pointing at a Customer that doesn't exist); leave it off when you're importing or staging data where the referenced records may not be present yet.

Where: Object › Schema, lookup field › Enforce Foreign Key Constraint

FAQs

What happens when I delete a record that other records link to?

The delete goes through — nothing blocks it, and nothing cascades. The foreign-key constraint is checked only when a record is saved, not when the record it points to is deleted. So deleting a linked-to record leaves the records that referenced it holding a dangling reference: their lookup value still stores the old ID, which no longer resolves to a record. Records that point at the deleted one are never deleted or edited automatically. If that matters for your data, clean up the referencing records yourself (edit them, or update them in bulk through an automation) before or after deleting the target.

Where: Object records › delete a record that others reference

Can a record link to another record in the same object?

Yes. Point a lookup field at the same object it lives on to create a self-relationship — useful for hierarchies and links within one set of records, such as an Employee whose manager field looks up another Employee, or a Category with a parentCategory. Use a single-select lookup when each record points to one other record (each employee has one manager — though many can share the same one), and a multi-select lookup when each record points to several others. It works exactly like linking two different objects; the target object just happens to be itself.

Where: Object › Schema, self-referencing lookup