Skip to main content
A relation links records in one collection to records in another, such as orders to customers or students to courses.

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.
Bludia adds the relation field(s) for you.

Labels from several fields

A label can combine fields. Pick first_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. Send record IDs in the relation field:
On update, sending a list replaces the linked records. Relation fields come back as { id, label } objects, or a list of them for many-to-many. Trashed related records are left out.
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 with filters:

Relations and security

  • A row policy of type relation lets 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

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.
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.