Link, lookup and rollup fields

Connect records across datasets, show a linked record's values, and calculate totals over linked records.

Real business data is connected: a project belongs to a client, a deliverable belongs to a project. Typing the client's name into every project row works until someone spells it differently, and then no report adds up. Three field types solve this together:

TypeWhat it doesNorthwind example
Two-way link dataset recordPoints a record at records in another dataset, and adds the reverse link automaticallyClient on Projects
Two-way link lookupShows a value from each linked recordClient city on Projects
Two-way link rollupCalculates a number across all linked records: count, sum, average, minimum, maximumHours booked on Clients

Lookups and rollups are calculated when records are read. Nobody types them and they're never out of date.

Note: Creating these fields needs the App Admin role in Datasets, like any other field. See Add a field to a dataset for the basics.

Step 1: Link two datasets

Create an internal field with the type Two-way link dataset record on the dataset that belongs to the other one, for example on Projects:

  • Linked dataset: The dataset to point at, here Clients.

  • Allow linking multiple records: Leave it off when a project has exactly one client. Turn it on for many-to-many relations, such as a project with several vendors.

  • Display fields: The values shown on each linked record's chip and in the picker.

Click Create & Assign. Two things now exist: the Client column on Projects, and a reverse column on Clients (named Client (back-link)) that lists each client's projects. Editing either side updates the other.

In the grid, a linked value shows as a chip. Click the cell to pick records from the other dataset.

The Client link column on the Projects grid

Step 2: Show a value from the linked record with a lookup

On Projects, create an internal field named Client city:

  • Type: Two-way link lookup.

  • Source link field: The link to read through, here Client. The dialog confirms which dataset it reads from.

  • Field to look up: The field to show from that dataset, here City.

Click Create & Assign. Every project now shows its client's city, and it changes on its own the day the client moves.

A lookup field reading City through the Client link

Step 3: Calculate across linked records with a rollup

On Clients, create an internal field named Hours booked:

  • Type: Two-way link rollup.

  • Link source field: The link that points at the records to aggregate, here the reverse link Client (back-link). The dialog shows the linked dataset, Projects.

  • Field to rollup: The number to aggregate, here Estimated hours.

  • Aggregate function: Count, Min, Max, Sum or Average. Here Sum.

Click Create & Assign.

A rollup field summing Estimated hours through the reverse link

Note: Field to rollup lists the number fields of the linked dataset: Integer, Decimal, Currency, Rating, Progress and Formula. The list loads a moment after you choose the link source, so give it a second. If it still reads No numeric fields in the linked dataset., that dataset has no number field yet, so add one first.

Step 4: Read the calculated columns

Lookup and rollup columns appear on the grid like any other field, but their cells can't be edited: change the linked records and the values follow.

The Hours booked rollup column on the Clients grid

Rollup ideas for the same data

OnFieldLink sourceField to rollupFunction
ClientsHours bookedClient (back-link)Estimated hoursSum
ClientsLargest projectClient (back-link)Estimated hoursMax
ClientsProject countClient (back-link)Estimated hoursCount
ClientsFees bookedClient (back-link)FeeSum

Step 5: See how everything connects

Open the caret next to the dataset name and choose Visualize schema. The diagram draws every dataset involved and the relations between them. The legend separates Two-way link edges from Lookup / Rollup edges, and each field is labelled with its kind, such as link, lookup or select.

It's read-only: drag the boxes to tidy the picture, then close it.

The Visualize schema diagram of Projects and Clients

Warning: Deleting a link field breaks every lookup and rollup that reads through it. Check Visualize schema before unlinking a link field from a dataset.