1/31/2022

Airtable Bigquery

The CData Excel Add-In for Airtable provides formulas that can query Airtable data. The following three steps show how you can automate the following task: Search Airtable data for a user-specified value and then organize the results into an Excel spreadsheet.

What is BigQuery? BigQuery on the other hand is SQL data warehouse (not like traditional database). It means that it is designed to do various (analytical) queries under large amount (order of tera / peta bytes) of data very quickly. Difference between BigTable vs BigQuery? About Airtable Airtable is an organization tool that integrates with other apps and services for more streamlined business communication.

Airtable Data Integration: ETL from Airtable to Snowflake, BigQuery, Redshift, and more with Rivery. Learn more today! The Airtable Excel Add-In is a powerful tool that allows you to connect with live Airtable data, directly from Microsoft Excel. Use Excel to read, write, and update Airtable Tables, etc. Perfect for mass imports / exports / updates, data cleansing & de-duplication, Excel based data analysis, and more!

Airtable Data Integration: ETL from Airtable to Snowflake, BigQuery, Redshift, and more with Rivery. Learn more today!

Bigquery

The syntax of the CDATAQUERY formula is the following: =CDATAQUERY(Query, [Connection], [Parameters], [ResultLocation]);

This formula requires three inputs:

  • Query: The declaration of the Airtable data records you want to retrieve, written in standard SQL.
  • Connection: Either the connection name, such as AirtableConnection1, or a connection string. The connection string consists of the required properties for connecting to Airtable data, separated by semicolons.

    APIKey, BaseId and TableNames parameters are required to connect to Airtable. ViewNames is an optional parameter where views of the tables may be specified.

    • APIKey : API Key of your account. To obtain this value, after logging in go to Account. In API section click Generate API key.
    • BaseId : Id of your base. To obtain this value, it is in the same section as the APIKey. Click on Airtable API, or navigate to https://airtable.com/api and select a base. In the introduction section you can find 'The ID of this base is appxxN2ftedc0nEG7.'
    • TableNames : A comma separated list of table names for the selected base. These are the same names of tables as found in the UI.
    • ViewNames : A comma separated list of views in the format of (table.view) names. These are the same names of the views as found in the UI.
  • ResultLocation: The cell that the output of results should start from.

Air Table Bigquery

Pass Spreadsheet Cells as Inputs to the Query

The procedure below results in a spreadsheet that organizes all the formula inputs in the first column.

  1. Define cells for the formula inputs. In addition to the connection inputs, add another input to define a criterion for a filter to be used to search Airtable data, such as Column1.
  2. In another cell, write the formula, referencing the cell values from the user input cells defined above. Single quotes are used to enclose values such as addresses that may contain spaces.
  3. =CDATAQUERY('SELECT * FROM SampleTable_1 WHERE Column1 = '&B5&'','APIKey='&B1&';BaseId='&B2&';TableNames='&B3&';ViewNames='&B4&';Provider=Airtable',B6)
  4. Change the filter to change the data.

Always-on applications rely on automatic failover capabilities and real-time data access. CData Sync integrates live Airtable data into your Google BigQuery instance, allowing you to consolidate all of your data into a single location for archiving, reporting, analytics, machine learning, artificial intelligence and more.

Configure Google BigQuery as a Replication Destination

Using CData Sync, you can replicate Airtable data to Google BigQuery. To add a replication destination, navigate to the Connections tab.

  1. Click Add Connection.
  2. Select Google BigQuery as a destination.
  3. Enter the necessary connection properties. To connect to Google BigQuery, use OAuth authentication:

    Authenticate with a User Account

    In this OAuth flow, you can connect without setting any connection properties for your user credentials.

    1. Click Connect, and CData Sync opens the Google BigQuery OAuth endpoint.
    2. Log in and grant permissions to CData Sync.
    3. CData Sync then completes the OAuth process.

    Authenticate with a Service Account

    Service accounts have silent authentication, without user authentication in the browser. You can also use a service account to delegate enterprise-wide access scopes to CData Sync.

    You need to create an OAuth application in this flow. See Creating a Custom OAuth App in the Getting Started section to create and authorize an app. You can then connect to Google BigQuery data that the service account has permission to access.

    After setting the following connection properties, you are ready to connect:

    • OAuthClientId: Set this to the Client ID in your app settings.
    • OAuthClientSecret: Set this to the Client Secret in your app settings.
    • OAuthJWTCertType: Set this to 'PEMKEY_FILE'.
    • OAuthJWTCert: Set this to the path to the .pem file you generated.
    • OAuthJWTCertPassword: Set this to the password of the .pem file.
    • OAuthJWTCertSubject: Set this to '*' to pick the first certificate in the certificate store.
    • OAuthJWTSubject: Set this to the email address of the user for whom the application is requesting delegate access. Note that delegate access must be granted by an administrator.
    • DatasetId: Set this to the ID of the dataset you want to connect to.
    • ProjectId: Set this to the ID of the project you want to connect to.
    When you connect, CData Sync completes the OAuth flow for a service account.
  4. Click Test Connection to ensure that the connection is configured properly.
  5. Click Save Changes.

Configure the Airtable Connection

You can configure a connection to Airtable from the Connections tab. To add a connection to your Airtable account, navigate to the Connections tab.

  1. Click Add Connection.
  2. Select a source (Airtable).
  3. Configure the connection properties.

    APIKey, BaseId and TableNames parameters are required to connect to Airtable. ViewNames is an optional parameter where views of the tables may be specified.

    • APIKey : API Key of your account. To obtain this value, after logging in go to Account. In API section click Generate API key.
    • BaseId : Id of your base. To obtain this value, it is in the same section as the APIKey. Click on Airtable API, or navigate to https://airtable.com/api and select a base. In the introduction section you can find 'The ID of this base is appxxN2ftedc0nEG7.'
    • TableNames : A comma separated list of table names for the selected base. These are the same names of tables as found in the UI.
    • ViewNames : A comma separated list of views in the format of (table.view) names. These are the same names of the views as found in the UI.
  4. Click Connect to ensure that the connection is configured properly.
  5. Click Save Changes.
Air table bigquery

Configure Replication Queries

CData Sync enables you to control replication with a point-and-click interface and with SQL queries. For each replication you wish to configure, navigate to the Jobs tab and click Add Job. Select the Source and Destination for your replication.

Airtable Query

Airtable queryBigquery

Replicate Entire Tables

To replicate an entire table, click Add Tables in the Tables section, choose the table(s) you wish to replicate, and click Add Selected Tables.

Customize Your Replication

You can use the Transform feature to customize your replication. The Transform feature allows you to specify which columns to replicate, rename the columns at the destination, and even perform operations on the source data before replicating. To customize your replication, click the Transform button in the Tables section and customize the replication.

Schedule Your Replication

In the Schedule section, you can schedule a job to run automatically, configuring the job to run after specified intervals ranging from once every 15 minutes to once every month.

Once you have configured the replication job, click Save Changes. You can configure any number of jobs to manage the replication of your Airtable data to Google BigQuery.