I set up a two-way sync between Airtable and Glide Big Tables

Hi,

I managed to set up a fairly clean two-way sync between Airtable & Glide Big Tables. Whilst there is some technical aspect of setting this up, it runs pretty much instantly and I am pretty happy with how reliable it has been so far.

Project Context:

  • I have create a directory website (in Webflow)
  • I control all of my directory data from Airtable and sync it with Whalesync
  • I have no create a Glide portal for the business owners to control the data on their pages

How the syncing works:

  • Webflow ↔ Airtable (via Whalesync)
  • Airtable → Glide (via Airtable Automation and Scripts)
  • Glide → Airtable (app interaction triggers a webhook in Airtable Automations that retrieves the Glide record and updates the corresponding Airtable record)

Create/Update in Glide

The way this script works is that it:

  1. Is triggered by a condition in Airtable (more on this later)
  2. That triggers a script in Airtable automation that retrieves the Airtable record
  3. The script then maps all Airtable fields to its corresponding Glide fields
  4. The script checks if the Glide Record already exists by checking if “Glide Row ID” for that record in Airtable exists or not
  5. If it exists, it updates the existing Glide record, else it creates a new record
  6. If it creates a new record, it updates the Airtable record with the Glide Record ID for future reference.
  7. For updating and creating new Glide records, I also save a timestamp in Airtable for the last time Glide was updated, to ensure the records are not out of sync.

Glide → Airtable: Upsert/Delete User Generated Content

To be keep Airtable in sync with changes made in Glide, I have two scripts that are triggered by webhook data being received from Glide.

At the end of my app interaction steps I added a “Trigger webhook” action that passes through the Glide Row ID.

I have one trigger for when a new record is created or an existing record is updated, and a seperate trigger for when a user deletes a record in Glide - the both work the same, the script just does the action that corresponds.

In the case of a record being created or updated in Glide, the script does the following:

  1. The script checks if the record exists in Airtable by checking for the Glide Row ID that was passed through.
  2. It then makes an API call to Glide to retrieve all of the latest data for that record.
  3. I then have field mapping set up that maps Glide fields to Airtable fields.
  4. Then I either update or create a record with the information provided via Glide.
  5. If a new record is created in Airtable, I update Glide with the corresponding Airtable ID for later reference.
  6. In both instances, I update Glide with a date time field for when the Airtable was last updated, so I can see if any records are out of sync.

Tips:

  1. I used my existing Airtable bases to create the schema of the Glide big tables that made mapping Airtable and Glide a lot easier.
    Create Table - Glide API Docs
  2. To avoid infinite loops, I would recommend setting up a condition-based trigger first in Airtable (i.e. when a checkbox is checked), so you can control when and what gets synced.
  3. I would only sync fields from Glide that users can actually change.

Final thoughts:
If you are using the native Glide/Airtable sync, this here is a lot faster and with Big Tables you won’t run into record limits.

Hopefully this is useful.

3 Likes