Link To Another Record

If you are using NocoDB with version 0.90 onwards, please check out the latest documentation here instead. The documentation for previous versions is no longer maintained and will be completely removed on 30 Jun 2022. See v0.90 Important Announcement for more.

Relationship types:

  • One to one
    • A Table record in first table is related to only one record of second table.
    • Example: Country has a capital city
  • One to many
    • A Table record in first table is related to more than one record of second table. But second table record maps to only one entry of first table
    • NocoDB refers to this category of relationship as has many
    • For every has many relation defined, NocoDB augments belongs to relationship column in the other table automatically
    • Example: Country has many Cities. (other way mapping > City belongs to Country )
  • Many to many
    • A Table record in first table is related to more than one record of second table; second table record can also map to more than on record of first table.
    • NocoDB refers to this category of relationship as many to many
    • For every many to many relation defined between tables, NocoDB augments many to many relationship column in the other table automatically
    • Example: Film has many Actors. Actor has many Films (works on many films)

Further details of relationship types can be found here

Relationships between table records can be established by using LinkToAnotherRecord column type. Workflow details are captured below

Adding a relationship

1

1. Create column

Click on '+' button at end of column headers

2. Update column name

Input name in the text box provided

3. Select column type

Select Column type as "LinkToAnotherRecord" from the drop-down menu

4. Choose relationship type

'Has Many': corresponds to the 'One-to-many' relationships 'Many To Many': corresponds to the 'Many-to-many' relationships

5. Select child table from drop down menu

6. Click on 'Save'

A new column will get created in both the parent table & child table

Updating linked records

Click on the '+' icon in corresponding row - cell 2truncate

2. Select from the option displayed

Use 'Filter box' to narrow down on search items You can opt to insert a new record as well, using "+ New Record" button 3

3. Column mapping showing "Has Many" relationship

Country 'has many' City

4. Column mapping for "Belongs to" relationship [Automatically updated]

City 'belongs to' Country 4