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
- In SeekWell, go to Source → "Add source" in the top right of the app
- Add your Airtable API key to the source
- Go to https://airtable.com/api and click on the base you want to connect to. Check the URL for the Base / App ID, it start with "app". It's also shown in green on this page in third paragraph
- Write some SQL! Use the Base ID (
appkLTrRdxeM51z0P
in this example) as the SQL schema name and the table name to test aSELECT
statement
You can get your API key here on your account page (Click on "Generate key" if one isn't already there
select *
from appREPLACEWITHYOURID."Opportunities"
limit 10
Double quotes (
"
) are required for Tables with space(s) in the name. For example, a table name of "This Has Spaces" will be SELECT * FROM apppId."This Has Spaces"
Joining Tables
- SeekWell adds two special columns to your Table:
-
__id
is the unique id for the record in your table, use this to join to "Linked" records / tables __createdTime
is the timestamp for when the record was created- In the Sales CRM Base, there is an
Accounts
table and aContacts
table. To join them, let's use the firstid
of the first linkedContact
and get theirName
You can use these like any other column
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 necassary because Airtable return a linked records as an array. This substring gets just the id
of the first item in the array