Skip to main content
Version: Latest

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 multiple Cities.
  • Belongs-to - Multiple records in one table can have a single record in another table.
    • Example: A City Belongs-to a Country.
  • Many-to-Many - Multiple records in one table can have multiple records in another table.
    • Example: A Student can have multiple Subjects & a Subject can have multiple Students.
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 augments Belongs-to relationship field in the adjacent table automatically
  1. Click on + icon to the right of Fields header
  2. On the dropdown modal, enter the field name (Optional).
  3. Select the field type as Links from the dropdown.
  4. Select the relation type : Either Has-Many or Many-to-Many.
  5. Select the table to which the relation is to be established with.
  6. Configure label to be used for display in the cell. Defaults to Link, Links (Optional).
  7. Click on Save Field button.

image

Cell display

The cell will display number of links for a record to the related table.

image

Clicking on the link-text will open a Linked Records modal with the list of links & associated additional information.

List linked records

image

List of linked records will appear as a dropdown containing linked records as cards. A brief note about the modal components:

  1. Search bar, to narrow down the list of linked records displayed
  2. Icon represents Many-to-Many relation. The count indicates the number of linked records
  3. List (cards) of linked records
  4. To view additional information (expanded record), hover on the card & click on the <> icon
  5. Click on the - icon to unlink the record
  6. Click on + New record button to create and link a new record to the current one
  7. Click on Link more records to link an existing record Read more
  8. Pagination bar

Modal to add new links can be opened by

  • Clicking on + Link more Records button in the Linked Records modal
  • Clicking on the + icon in the cell (appears on clicking on the cell)

image

A brief note about the modal components:

  1. Search bar, to narrow down the list of records displayed
  2. Icon represents Many-to-Many relation. The count indicates the number of linked records
  3. List (cards) of records available for linking
  4. To view additional information (expanded record) before linking, hover on the card & click on the <> icon
  5. Click on the + icon to link the record
  6. Click on + New record button to create and link a new record to the current one
  7. Pagination bar
info

Multiple records can be linked at once.

To unlink a record, open the Linked Records modal & click on the - icon on the card of the record to be unlinked.

info

Multiple records can be unlinked at once.