Foreign Keys in Google Sheets
Last updated
Last updated
Foreign Keys in Whalesync allow you to create relationships between tables in your synced Google Sheets. Here’s a quick guide on how to set them up and use them effectively:
To set up a foreign key column:
Rename the desired column in your Google Sheet table to follow the format:
related_[Table Name]
Replace [Table Name]
with the name of the related table.
Example: if you want to link to a table named Leads
, name the column related_Leads.
Note: capitalization matters here, so make sure the table name matches exactly.
Make sure the field is a 2-way sync if that is your preference.
If you already have the field mapped, you can delete the field, refresh, then re-add the field for it to be updated as a Foreign Key.
To link a row from another table to your Foreign Key column:
Find the Whalesync ID of the row you want to reference in the related table.
The Whalesync ID is a unique identifier for each row. It is Column A in each mapped table in Google Sheets, and it is hidden. Click on the arrow here to unhide the Whalesync ID column.
Avoid making any changes to the Whalesync ID column to avoid sync issues.
Paste the Whalesync ID into the foreign key column.
For example, to link a lead from the "Leads" table to a "related_Leads" column in the "Companies" table:
Go to the Leads table and copy the Whalesync ID of the lead you want to link
Paste it into the "related_Leads" column in the "Companies table
In the example below, the "related_People" column in the Companies table links to 3 People records using their Whalesync IDs.