LogoLogo
WelcomeGet Started
  • What is Whalesync?
  • Start Here
    • Quick start
    • Video tutorials
  • Popular Syncs
    • Webflow + Airtable
    • HubSpot + Notion
    • Supabase + Airtable
    • Notion + Google Sheets
  • Connectors
    • Affinity
      • Authorize Affinity
      • Full records vs. shallow records
      • List-specific fields
      • Notes in Affinity
    • Airtable
      • Airtable view sync
      • Airtable API quota
    • Attio
    • Google Sheets
      • Formatting columns
      • Foreign keys
      • Multi-select fields
      • Avoid sort range
      • Whalesync ID column
    • HubSpot
      • Associations
      • Webhooks
      • Merging records
    • Memberstack
      • Authorize Memberstack
      • Memberstack custom fields
    • Notion
      • Notion page sync
    • Postgres
      • Authorize Postgres
        • AWS (RDS)
        • Basedash
        • DigitalOcean
        • Heroku
        • Neon
        • Render
        • Supabase
      • SQL scripts
      • Primary key snippets
      • Foreign key snippets
      • Terminology
      • Multiple foreign keys in a single field
      • How to sync Postgres views
    • Salesforce
    • Stripe
      • Authorize Stripe
    • Supabase
      • Adding default values to primary keys
      • How to sync Airtable linked records with Supabase foreign keys
      • Why does Whalesync create a database user?
      • Why do I need an ID column?
      • SQL scripts
      • Primary key snippets
      • Foreign key snippets
      • Terminology
      • Multiple foreign keys in a single field
      • How to sync Postgres views
    • Webflow
      • Supported fields - (AT x WF)
      • Webflow Memberships sync
      • Webflow status field
  • Previous connectors
    • Bubble
      • Authorize Bubble
    • Close
    • Copper
    • MS Dynamics CRM
    • Outreach
    • Pipedrive
      • Pipelines
    • Shopify
      • Authorize Shopify
      • Syncing images
      • Syncing variants
      • Tutorial videos
      • Theme Template field
    • WordPress.com
    • WordPress.org
      • Quick Start Guide: WordPress.org
      • Authorize WordPress.org
      • Advanced Custom Fields (ACF)
      • How to sync images
      • Supporting tables
      • Tutorial
      • WordPress status field
    • Zoho CRM
  • Features
    • Two-way sync
    • Issues
    • Operations
    • Record matching
    • Filters
    • Auto-create tables
    • Additional features
      • Automapping
      • Creating users via Whalesync
      • Delete protection
      • File hosting
      • HTML and Markdown field extensions
      • Relation fields
      • Sync preview
  • Resources
    • Support
      • Sync behavior questions
      • Common errors - Airtable
      • Common errors - Notion
      • Common errors - Postgres
      • Common errors - Webflow
      • FAQ
      • Field compatibility
      • How to get record IDs
      • How to change your sign-in
      • How to change your email
      • How to add additional email addresses
      • How to update your tax ID number
      • How to create a slug field in Airtable
      • Known issues
      • Multi-select to multi-reference
      • Transfer Webflow site to another account
      • Troubleshooting attachment fields
      • Webflow deprecating v1 APIs
    • Template Packs
  • YouTube
  • Security
  • Changelog
Powered by GitBook
On this page

Was this helpful?

  1. Connectors
  2. Google Sheets

Foreign keys

An explanation of how to set up foreign key (aka reference) field relationships in Sheets

PreviousFormatting columnsNextMulti-select fields

Last updated 4 months ago

Was this helpful?

Foreign keys allow you to create relationships between tables in your synced Google Sheets.

How to set up foreign keys

1. Define a foreign key column

Create a column in the following format: Related_[Table Name]

Capitalization matters, so make sure the table name matches exactly.

2. Map the Foreign Key field in Whalesync

You will likely need to click "Referesh" to ensure Whalesync sees your newest fields

3. Insert Foreign Key values

To link a row from another table to your Foreign Key column:

  1. Copy the Whalesync ID of the row you want to reference.

  2. Paste the Whalesync ID into the foreign key column.

  • 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 to unhide the Whalesync ID column.

Avoid making any changes to the Whalesync ID column to avoid sync issues.

Google Sheets foreign key fields map with in other apps.

reference fields
An example of a foreign key field relating People to Tasks
Here our column name is "Related_People" because we're relating Tasks to the People table
Copying the Whalesync ID from a person in the People's table into the "Related_People" column in Tasks