For more explanations of what table relationships are, see this help center article.
When to use table relationships
Use table relationships to link data together between tables and reduce copy/pasting and duplication of information.
Relationships allow us to represent concepts like:
- If you have a table of Projects and a table of Teams, you can link a particular project with a specific team, to indicate which teams work on which projects.
- With these Projects and Teams linked together, you can pull in information from the table using Lookup columns to see more details about the linked team. Or we can aggregate insights about the linked table using Summary columns to do things like count up the # of teams working on a project.
How a table relationship works
- When creating a relationship, you need to specify a unique name and a target table that you plan to "link data" from. This target table can be the current table, which is called "self-linking" and allows representing relationships like: a task is dependent on another task in the same table, or a person is a parent to another person in the same table.
- Relationships have an explicit direction, with an origin table and target table. For example, you can have a master table of Teams, and many different tables may have relationships that link to the Teams table as the target table. When you create a relationship, the relationship will start with the origin as the current table, and then link to the target table. When viewing the Relationships dialog, you can see a list of relationships originating from the table, as well as relationships linking from other tables.
- When two tables are linked together via a relationship, changes to row data in one table will automatically update for linked rows in the other. For example, if a team changes its name, then any projects that were linking to those teams would see the updated team name automatically. Or if a team removes a project it is linked with, then the # of teams working on that project will automatically decrement.
- You can click on the "Relationships" toolbar button, or the "Open in Relationships dialog" when editing a Lookup or Summary column to get to the Relationships dialog, which lets you create and manage all your existing relationships, or even add more advanced filters to control what information is shown.
- You can also create multiple relationships to the same table. For example, in our "Using Table Relationships" template, we have two separate relationships from Flights to Airports, to represent an "arrival" vs "departure" airport.
Creating table relationships
To create a table relationship, you can do this in multiple ways:
- Through the Column settings dialog when adding a Lookup columns.
Link tables and lookups with Tables
- Through the Relationships dialog, which you open from the "Relationships" toolbar button.
Tables Help Center: Using the relationship dialog
- Click the "Relationships" button in the toolbar.
- Click the "Add new relationship" button in the Relationships dialog.
- Select a table to link to, and set a custom name for the relationship (autofills to table name).
- Add lookup columns to pull in data from the other table (select a source column and can set a custom name)
- (optional) Add a relationship filter to restrict what rows can be linked to (see below).
Relationship filters
You can restrict what rows can be selected in a Lookup column, or filter which rows are summarized in a Summary column, by configuring a relationship filter in the Relationships dialog. This allows you to do things like:
- Only allow selecting Projects with an "Active" status to link to.
- Only count up linked Teams that are part of the "Marketing" org.
See this YouTube video walkthrough for using relationship filters:
With relationship filters, now you have more control when linking data between tables