Relationship Field
The Relationship field is used to create connections between two tables. Unlike standard data fields (like Text or Number), this field does not store a simple value; instead, it stores a reference (link) to a record in another table.
Creating a relationship allows you to query related data in a single request (e.g., “Get this Author and all their Books”).
Configuration Properties
Section titled “Configuration Properties”When configuring a Relationship field, the settings define the Cardinality (how many records can be linked):
- Name: The name of the field as it will appear in the API (e.g.,
author,orders,profile). - Related Table: The target table you want to link to. (e.g., If you are in the Comments table, you might select the Users table).
- Type (Cardinality): This section defines the rules of the relationship using radio buttons. The text here changes dynamically based on the tables selected, but generally offers two paths:
- Allow multiple [Current Table] per [Related Table]: Select this to create a One-to-Many relationship (e.g., One Author can have many Books).
- Allow one [Related Table] per [Current Table]: Select this to enforce a One-to-One or strictly limit the connection (e.g., One User has exactly one Profile).
- Description: An optional note explaining the nature of the relationship.
- Mandatory: If enabled, the record cannot be saved unless it is linked to a record in the related table.
- Unique: If enabled, ensures that a specific record from the related table can only be linked once.
Relationship Types Explained
Section titled “Relationship Types Explained”| Relationship | Description | Example |
|---|---|---|
| One-to-One | Record A links to only one Record B, and vice-versa. | User <-> Profile |
| One-to-Many | Record A is linked to many Record Bs, but Record B is linked to only one Record A. | Author <-> Books |
Note: When you create a relationship field in one table, the system automatically creates the corresponding “inverse” field in the related table to ensure the connection works both ways.