Skip to content

Relations Between Entities

This section is temporarily hidden from the left menu by default (it's still under development), but the feature is fully functional. You can open the relations list directly at /relations. Relations can also be created and edited right from the entity builder — this approach is described in detail below and is currently the primary one.

What is a relation

A relation connects two entities (or an entity with itself) so that the record card of one entity shows records of the other. For example: "Customer" ↔ "Tickets," "Employee" ↔ "Absence Requests," a category tree linked to itself (parent-child).

Each relation is stored as a separate object with a system name, a type, and two sides — a "left" and a "right" entity.

Relation types

TypeNotationMeaning
One-to-Many (1 → ∞)one_to_manyOne record of the left entity is linked to several records of the right entity (for example, "Customer" → many "Tickets")
Many-to-One (∞ → 1)many_to_oneThe reverse side of one-to-many: the current entity references a single record of another entity
Many-to-Many (∞ ↔ ∞)many_to_manyEach record on the left can be linked to several records on the right and vice versa (for example, "Employees" ↔ "Projects")

When saved, the many_to_one type is automatically converted to one_to_many with the sides swapped — these are just two views of the same relation.

Creating a relation from the entity builder

This is the primary way to create a relation. Open an entity in the builder (the Entities section) and go to the Relations tab.

  1. Click + Add Relation
  2. Fill in System Name — the relation's technical name (for example incidents_to_users); it can't be edited after saving
  3. Choose a Relation Type: One-to-Many, Many-to-One, or Many-to-Many
  4. The current entity is automatically placed on one side; choose the second entity from the list (system and custom entities are shown in separate groups)
  5. Fill in Display Label — the relation name users will see on the tab in the record card (set separately for each interface language and for each side of the relation)
  6. Optionally expand the Filters section and define conditions to restrict which records are shown as related (field + operator =, , >, <, , , "contains," "does not contain" + value)
  7. Optionally set the Sort Order — the display order of this relation among the other tabs on the record card
  8. Click Save

A list of the entity's existing relations is shown to the left of the form; relations can be dragged to reorder, edited, and deleted.

If both sides of a relation are the same entity (a typical case is a category hierarchy via a "Parent" field), the form shows labels for both sides at once, since the "own" side can't be determined from the table name.

A separate "Relations" section (/relations)

Besides the tab in the entity builder, there's a separate list of every relation in the system — a table with columns: left entity, system name, right entity, type, settings. Available directly at /relations; creating a new relation is at /relations/new. Functionally, it's a simplified version of the same form (no filter builder or multilingual labels), but it also preserves the one-to-many / many-to-many type.

If relations are configured for an entity, the record card (as described in Navigation) shows extra tabs — one per relation, named according to its Display Label. The tab shows a table of records from the other entity that are linked to the current record:

  • The Add button lets you find and link an existing record of the other entity (only records that pass the relation's filter, if one is set, are available)
  • The Create button lets you create a new record of the other entity right away, automatically linking it to the current one
  • From the table, you can open the related record or remove the link (without deleting the record itself)

If the entity has a state model configured, there's a Status tab with a transition timeline next to the relation tabs, as well as a Relation Graph tab — a visual diagram of which records of other entities the current record is linked to.

Where else relations are used

  • The entity field builder has a field type that lets you select one or more records of another entity through an existing relation (multiple record selection) — useful when related records need to be shown directly in the form rather than on a separate tab.
  • Relations are taken into account when configuring fields with dependencies ("show only records not yet linked through this relation" and similar filters) in the entity builder.

See also

Orbita ITSM documentation