How to Visualize an Airtable Database in Looker Studio
Anyquery allows you to write SQL queries on pretty much any data source, including Airtable. This tutorial guides you through visualizing an Airtable database in Looker Studio (formerly Google Data Studio) using Anyquery.
Prerequisites
Before starting, ensure you have the following:
- A working installation of Anyquery. Follow the installation instructions here.
- An Airtable account and a created table in Airtable. Ensure the schema is correctly defined.
- Looker Studio access with a Google account.
Step 1: Install and Configure the Airtable Plugin
First, install the Airtable plugin:
anyquery install airtable
You will be prompted to provide the following details:
- Airtable API Key: Create an API key from the Airtable account page.
- Base ID: Find it in the URL of your Airtable base.
- Table Name: The table name you want to visualize.
- Enable Cache: Choose whether to enable caching for faster queries.
Step 2: Start the Anyquery Server
Launch the Anyquery server:
anyquery server
Because Looker Studio is a web-based tool, and anyquery
binds locally, you need to expose the server to the internet. You can use a tool like ngrok to create a secure tunnel to your local server.
ngrok tcp 8070
Copy the forwarding URL (e.g., tcp://0.tcp.ngrok.io:12345
) and use it as the hostname in the next step.
Step 3: Connect Looker Studio
- Open Looker Studio in your browser.
- Click on the
+
icon (empty report) to create a new report. - In the search bar, type
MySQL
and select theMySQL
connection. - Authorize Looker Studio to access your data.
- Fill in the following details:
- Selecting a table does not work in Looker Studio. You can only run SQL queries by clicking on the "Personalized query" tab and typing your query. Example:
SELECT * FROM airtable_table;
. - Click on the
Authenticate
button to verify that the connection is successful.
:::caution
Looker Studio does not handle all column names well. If you have a column name with a space or special character, you might not be able to pick it up as a dimension or measure. You can rename the column in the query to work around this issue. For example, SELECT \
Column Name` AS `column_name` FROM airtable_table;`.
:::
Example of a Query
Here is an example query to list all records from your Airtable table:
SELECT * FROM airtable_table;
You can also filter and transform the data as needed. For instance, to filter records based on a specific condition, use:
SELECT * FROM airtable_table WHERE status = 'Active';
Creating Your First Visualization
- After running your query, click on the
Add to Report
button. - Create visualizations by dragging desired fields to the canvas and customizing the charts and tables as needed.
Conclusion
You have successfully connected Looker Studio to Anyquery and visualized your Airtable database. Now you can explore and create meaningful visualizations using Looker Studio.
For more information on Airtable queries, refer to the Airtable plugin documentation. For troubleshooting common issues, visit the troubleshooting guide.