Links
Links
field type is used to establish relationship between tables & create links to other records.
NocoDB supports following types of relations:
Has-Many
- A record in one table can have multiple records in another table.- Example: A
Country
can have multipleCities
.
- Example: A
Belongs-to
- Multiple records in one table can have a single record in another table.- Example: A
City
Belongs-to
aCountry
.
- Example: A
Many-to-Many
- Multiple records in one table can have multiple records in another table.- Example: A
Student
can have multipleSubjects
& aSubject
can have multipleStudents
.
- Example: A
note
- Links can be created only between tables in the same database.
- Self-referencing links are supported. (Link to the same table)
- For every
Has-Many
relation defined, NocoDB augmentsBelongs-to
relationship field in the adjacent table automatically
Create a link field
- Click on
+
icon to the right ofFields header
- On the dropdown modal, enter the field name (Optional).
- Select the field type as
Links
from the dropdown. - Select the relation type : Either
Has-Many
orMany-to-Many
. - Select the table to which the relation is to be established with.
- Configure label to be used for display in the cell. Defaults to
Link
,Links
(Optional). - Click on
Save Field
button.
Cell display
The cell will display number of links for a record to the related table.
Clicking on the link-text will open a Linked Records
modal with the list of links & associated additional information.
List linked records
A brief note about the modal components:
- This modal is displaying linked records for
PENELOPE
- Icon represents
Many-to-Many
relation - Linked records belong to
Film
table - Search bar, to narrow down the list of linked records displayed
- List (cards) of linked records
- To view additional information (expanded record), hover on the card & click on the
<>
icon - Indicates total records linked
- Pagination bar
- Click on
+ Link more Records
button to add new links : Read more
Link new records
Modal to add new links can be opened by
- Clicking on
+ Link more Records
button in theLinked Records
modal - Clicking on the
+
icon in the cell (appears on clicking on the cell)
A brief note about the modal components:
- Links being created are for
PENELOPE
- Icon represents
Many-to-Many
relation - Linked records belong to
Film
table - Search bar, to narrow down the list of records displayed
- Linked record card is displayed in blue color
- Records available for link are displayed in white color; use expand icon on the cord to view additional information
- Indicates total records linked (including the ones being linked)
- Pagination bar
info
Multiple records can be linked at once.
Unlink records
To unlink a record, open the Linked Records
modal & click on the card of the record to be unlinked.
info
Multiple records can be unlinked at once.