Skip to content

Developers · Data

Record Relations

Last updated 2 November 2026

You can create custom fields for storing data using or . allows you to store the of an existing object which you can then use to fetch the data using or the field in GraphQL.

To import/export data with relations preserved, you need to relate the tables using the attribute. This can be done using one of two ways:

  • Relating records using the Instance Admin
  • Relating records via code

Relating records using the Instance Admin

Visit the article Linking Databases Together for an in - depth guide on how to build relations between records using the Instance Admin UI. In a nutshell, the steps are as follows:

  1. Choose the database that you want to add relations to.
  2. Add a field to your chosen database.
  3. Make sure the field you are adding is a 'Data Source' field type.
  4. Select the database table that you want to connect to on the 'Data Source' options.

Relating records via code

To relate records via code, define relations in the Table files using the attribute.

app/schema/house.yml

name: house
properties:
- name: address
  type: string

app/schema/cars.yml

name: cars
properties:
- name: color
  type: string
- name: house_id
  type: integer
  belongs_to: house