Airtable

With SeekWell you can query your Airtable bases (including across multiple bases) using plain SQL (SQLite flavor).

To test this on an example Base, copy the Sales CRM Base in the Airtable Templates.

Connecting

  1. In SeekWell, select a block or select the plus icon in the top right and select New SQL to create a new block.

  2. Select Add source in the top right of the app. If you have a previous connection, select the connection nickname under Source and scroll down to select Add new source.

    Add new source

  3. Under Flavor, select Airtable. Enter a nickname under Nickname.

  4. Add your Airtable API key to the source and select Save.

    Add Airtable API key

    You can get your API key here on your account page. If you do not see an existing API key, select Generate key.

    Generate an Airtable API key

  5. Go to https://airtable.com/api and select the base you want to connect to. Check the URL for the Base / App ID, it should start with "app". The ID also appears in green on this page in third paragraph.

    Airtable ID in URL

    Airtable ID in paragraph

  6. Write a SQL query. Use the Base ID (appkLTrRdxeM51z0P in the example above) as the SQL schema name and the table name to test a SELECT statement.

    Airtable example
    select *
    from appREPLACEWITHYOURID."Opportunities"
    limit 10
Double quotes (") are required for Tables with spaces in the name. For example, a table name of "This Has Spaces" will be SELECT * FROM appId."This Has Spaces".

Joining tables

  1. SeekWell adds two special columns to your Table:

    1. _id is the unique id for the record in your table. Use _id to join to "Linked" records / tables.

    2. _createdTime is the timestamp for when the record was created.

      You can use these like any other column.

  2. In the Sales CRM Base, there is an Accounts table and a Contacts table. To join them, let’s use the first id of the first linked Contact and get their Name.

    select
    a.__id as account_id,
    a.__createdTime as account_created_on,
    a.Size as size,
    substr(a.Opportunities, 3, 17) as first_op,
    substr(a.Contacts, 3, 17) as primary_contact,
    c.Name as contact_name
    from
    appREPLACEWITHYOURID."Accounts" as a inner join
    appREPLACEWITHYOURID.Contacts as c on substr(a.Contacts, 3, 17) = c.__id
    limit 10
This substr is necessary because Airtable returns linked records as an array. This substring returns only the id of the first item in the array.

Was this page helpful?