# Link records between tables: links, lookups and rollups

> Connect records in two tables with a link field, then show their fields with a lookup, add them up with a rollup or count them.

Source: https://artavolo.com/page/link-to-another-record

A **Link to records** field connects a record to records in another table, such as tasks to their project or orders to their customer. Once records are linked, a **Lookup** shows a field of the linked records, a **Rollup** adds them up, and a **Count** says how many there are.

## Add a link field

1. Press the **+** after the last field and choose **Link to records**.
2. Under **Table**, pick the table to link to.
3. Leave **Allow linking to multiple records** on if a record can link to several, such as a project with many tasks. Turn it off if it links to one, such as an order's customer.
4. Press **Create field**.

The other table gets a field that links back. Link a task to a project, and the project's link field lists the task.

## Link records

1. Click the cell of the link field.
2. Type to search the other table, and pick a record. Keep picking to add more.
3. If the record does not exist yet, create it from the name you typed.
4. Press **Done**.

Click a linked record to see it, or open it in its own table.

## Pick only from a view

When the other table is long, let people pick only some of its records: open the link field's settings and choose a view of the other table under **Pick records from**, for example a view of active clients. The picker then lists only the records that view's filter keeps, and says which view. A base brought from Airtable keeps Airtable's "Limit record selection to a view"; set that view's filter again after the import, as Airtable does not hand filters over.

## Show a field of the linked records: Lookup

1. Add a field and choose **Lookup**.
2. Under **Link field**, pick the link field to read through.
3. Under **Field in the linked table**, pick the field to show, such as the project's deadline.

Each value shows as its own field shows it: a date as a date, an amount with its currency.

## Add up the linked records: Rollup and Count

A **Rollup** takes a **Link field** and a **Field in the linked table** like a lookup, then an **Aggregation**:

- `SUM`, `AVERAGE`, `MIN` and `MAX` for numbers, such as the hours of a project's tasks.
- `COUNT` (numbers), `COUNTA` (values that are not empty) and `COUNTALL` (every linked record).
- `ARRAYJOIN`, `ARRAYUNIQUE` and `CONCATENATE` to list the values as text.
- `AND` and `OR` for checkboxes: all done, or any done.

A **Count** field needs only the link field, and says how many records it links to.

## Good to know

- A table needs a link field before you can add a lookup, rollup or count to it.
- Lookups, rollups and counts cannot be edited: change the linked records instead. A [formula](https://artavolo.com/page/formula-field) can use them.
- They are worked out on the server as well as on the screen, so the API, AI chat and agents read the same values you see. The API cannot filter or sort records by them yet.
- A linked record in the trash leaves its link empty until someone restores it.
- Deleting a link field asks first, and deletes the field that links back and the lookups and rollups that read it.
- Only the base's owners add fields. Anyone who may edit records links them.
- From Airtable, links, lookups, rollups and counts arrive working, and the import checks their values against Airtable's.

## Related

- [Write a formula](https://artavolo.com/page/formula-field)
- [Field types](https://artavolo.com/page/field-types)
- [Move from Airtable](https://artavolo.com/page/move-from-airtable)
- [Delete or restore a table](https://artavolo.com/page/removing-a-sheet)
