12. Advanced Concepts
X-Sheets has three optional, sheet-level features that go beyond ordinary columns and views. They all control how reference columns (links between sheets) behave, and they are all configured in the same place: the Edit Sheet dialog.
Where to find them. Open the Data Editor, right-click (or long-press) the sheet tab at the bottom, choose Edit Sheet, and scroll down. Each panel only appears when it is relevant to the current sheet, so you will not see all three on every sheet.
12.1 Background: references and the parent hierarchy
A Reference column links a row to a row in another sheet — a “belongs-to” relationship. When references chain together they form a parent hierarchy. For example, in a field-service CRM:
Prestation → Installed product → Customer
Contact → Customer
Here a Customer is the common parent of both an Installed product and a Contact. The first two features below use this hierarchy.
12.2 Reference Constraints
When a sheet has two or more reference columns, their pickers can filter one another so they stay consistent. By default, picking a value in one reference narrows the others to rows that share a common parent.
Example. An Installed product has both a Customer reference and an optional Contact reference. Because a Contact also belongs to a Customer, the Contact picker automatically shows only the contacts of the customer you selected — you cannot accidentally attach another customer’s contact.
When the panel appears
The Reference constraints panel is shown when the sheet has a pair of references that can be co-constrained, or when the sheet sits on the parent hierarchy used to filter pickers on another sheet.
Controls
- Containment edges — A checkbox for each reference column. Checked (default) means the reference is treated as a parent the row “belongs to” and is used for filtering. Uncheck it when the reference is just a lookup link, not a parent — it is then excluded from the hierarchy.
- Reference pairs — For each pair of references, a mode:
- Auto (default) — Filter each picker at the nearest common parent.
- Off — The two references do not filter each other at all.
- Pin at — Filter at a specific ancestor sheet that you choose from the list.
Activate / deactivate
Constraints are on by default (mode Auto) for any pair of references that share a parent — there is nothing to switch on. To relax them: set a pair to Off to stop two references filtering each other, or uncheck a containment edge to remove a single reference from the hierarchy entirely.
12.3 Unique Constraints
A unique constraint forbids duplicate combinations of reference values. Pick one reference column for simple uniqueness, or several for a combined (composite) key.
- One reference — e.g. unique Visit on a billing sheet ⇒ each visit can be billed at most once.
- Several references — e.g. unique Student + Test ⇒ at most one result per student per test.
Only reference columns can be part of a unique constraint (uniqueness here guards associations; the identifier is already unique on its own).
Controls
- Declared constraints — Each existing key is listed; tap the trash icon to remove it.
- Add a constraint — Check the reference column(s) whose combined value must be unique, then tap Add unique constraint.
Enforcement
Unique constraints are checked whenever data changes — when you create or edit a row, import data, or sync from another device. A change that would create a duplicate is blocked with an error that names the sheet and the conflicting values.
Activate / deactivate
Adding a constraint activates it immediately; deleting it from the list removes the rule. Existing duplicates are not retroactively rejected — the rule applies to changes made after it is added.
12.4 Linkable References
This controls how an embedded list inside a parent form behaves. When a sheet appears as a Form View inside a parent record (a list whose reference column points back to that parent) and that reference is optional, the list can manage an association rather than only creating rows.
What changes when linking is on (the default)
| Element | Normal list | Linking on (optional reference) |
|---|---|---|
| + button | Creates a new row. | Link (chain-link icon) — attach an existing row. The picker offers rows not yet linked to any parent, scoped to ones that stay consistent with the parent. |
| Swipe | Deletes the row. | Detach (broken-link icon) — unlinks the row from this parent without deleting it. |
| Edit | Available. | Hidden — the list only links and unlinks, it never creates or destroys the row. |
Example. An Installed product has an optional Contact reference. On a Contact’s form, the “Installed products” list lets you link the customer’s existing units to that contact (and detach them later), instead of creating brand-new units there.
Controls
The Linkable references panel lists this sheet’s optional reference columns, each with a checkbox. Checked (default) allows linking and unlinking existing rows. Uncheck it to keep the ordinary create/delete behavior even though the reference is optional.
Note: Only optional references are listed. A mandatory reference (a row that must always belong to a parent) never enters link mode, because a row cannot be detached without leaving it orphaned. Linking also only appears once an embedded Form View has been set up for the reference (see Views & Filters → Form Views).
12.5 Summary
| Concept | What it does | Default | How to turn off |
|---|---|---|---|
| Reference constraints | Reference pickers filter each other to rows that share a parent. | On (Auto) for any pair sharing a parent. | Set the pair to Off, or uncheck a containment edge. |
| Unique constraints | Forbid duplicate reference values (single or composite key). | None declared. | Delete the constraint from the list. |
| Linkable references | Embedded lists link/unlink existing rows instead of create/delete. | On for optional references. | Uncheck the reference in the panel. |