多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2.9 KiB

title description position category menuTitle
Link To Another Record Link To Another Record 39 Usage Link To Another Record

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