Relation types
Create a relation
1
Open Relations
In your project, go to Relations → Create relation.
2
Pick the type and collections
Choose the type, the source collection, and the target collection. They must be different collections.
3
Choose label fields
Pick which field labels each side (for example
name for customers). Labels appear in the dashboard and in API responses.Labels from several fields
A label can combine fields. Pickfirst_name and then last_name as label fields and related records show as Jane Doe. The values are joined with a space by default; you can set another separator, such as -. Empty values are skipped. Searching a relation picker matches the words you type against the label fields in order.
Many-to-many on one side only
A many-to-many relation normally shows on both collections. Turn off Show on the other collection to keep it on the collection that defines it. The other collection then has no field for it. Links are kept, so turning the option back on shows them again. If something uses the other side’s field, such as a report, Bludia asks you to remove that use first.Write related records
Send record IDs in the relation field:Read related records
Relation fields come back as{ id, label } objects, or a list of them for many-to-many. Trashed related records are left out.
Expand related records with with
To get the full related records, pass related collection slugs in with. They are returned under children, keyed by the related collection’s name.
Filter by relation
Filter records by related record IDs withfilters:
Relations and security
- A row policy of type
relationlets end users see records linked to their own user record, for example projects where I’m a member. - Expanded children follow the same project boundaries as the parent.
Tips
Choose good label fields
Choose good label fields
Labels are what people see in pickers and what the API returns in
label. Use a readable, mostly unique field like name, title, or email.Model join data as its own collection
Model join data as its own collection
If a link has its own data (for example a student’s grade in a course), create a collection like
enrollments with relations to both students and courses.