Relational
Relational fields create foreign key relationships between collections, linking records together. They define how data in one collection relates to data in another.
View all settings
| Setting | Description |
|---|---|
| Field Name | Text input, required. Unique identifier for the relationship. |
| Display Label | Text input. Human-readable label shown in forms. |
| Default Value | Text input. Pre-filled value for new records (experimental). |
| Sort Order | Number input, defaults to 0. Position in field lists. |
| Icon | Icon picker. Visual identifier. |
| Relational Label | Dropdown. Field from target collection to display. Creates a lookup automatically. |
| Status | Toggle, defaults to true. Enable or disable the field. |
| Required | Checkbox. Make the relationship mandatory. |
| Description | Text area. Documents the relationship's purpose. |
| Form Visibility | Dropdown. Show in Add, Edit, or Both forms. |
| DB Field Name | Text input. Custom database column name. |
| Use as Index | Checkbox. Create database index for query performance. |
| Populate from Logged-In User | Checkbox. Auto-fill from active user's session. |
Relation Types
Use the Relation Viewer to select how collections are linked. Each type creates different database structures:
| Type | Icon | Description |
|---|---|---|
| One-to-One | Each record links to exactly one record in the target collection. Example: User → Profile | |
| One-to-Many | One record links to multiple records in the target collection. Example: Author → Books | |
| Many-to-Many | Records on both sides can link to multiple records. Creates a junction table. Example: Students ↔ Courses |
Basic Settings
Enter a Field Name using camelCase. The Display Label appears in forms. Set the Relational Label to specify which field from the target collection should display — this automatically creates a lookup field.
Relation Viewer
The visual Relation Viewer appears below the basic settings and lets you:
- Select the relation type using the icon toggles (One-to-One, One-to-Many, Many-to-Many)
- Choose the target collection — the collection you want to link to
- Configure record sets — define the source and target keys for the relationship
- Auto-generate name — optionally let Hyper name the relationship automatically
Many-to-Many Configuration
For Many-to-Many relationships, you have two options:
- Table auto generated (checked) — Hyper creates and manages the junction table automatically
- Manual configuration (unchecked) — You select an existing collection as the junction table and configure:
- Select collection — Choose the junction collection
- Source Field — Field linking to the source collection
- Target Field — Field linking to the target collection
Advanced Settings
The Description text area lets you document the relationship's purpose.
| Setting | Description |
|---|---|
| Form Visibility | Choose when this field appears: Add forms, Edit forms, or Both. |
| DB Field Name | Override the database column name for the foreign key. |
| Use as Index | Indexes this field to boost search and query performance. |
| Populate from Logged-In User | Auto-fills this field using data from the active user's session. |
Query Filters
The Query Filters tab lets you restrict which related records can be selected:
| Setting | Description |
|---|---|
| Field | Select a field from the target collection to filter on. |
| Operator | Comparison operator (is equal to, is not equal to, contains, etc.). |
| Value | The value to compare against. |
| From Form | Pull the filter value from a form field instead of a static value. |
| Optional | Make this filter condition optional. |
Click Add Filter to add multiple conditions.
Use Cases
- User → Profile — One-to-One relationship for extended user data
- Author → Books — One-to-Many for ownership relationships
- Students ↔ Courses — Many-to-Many for enrollments with junction table
- Order → Customer — Link orders to customer records
- Product → Category — Organize products into categories
Related
- Common Settings — Shared settings reference
- Lookup — For read-only related display
- Association — For aggregating related data