# Connect to Airtable

> Learn how to connect your application to an Airtable database to get and send data.

https://docs.pandasuite.com/essentials/integrations/connect-to-airtable/

**Easily connect your application to an Airtable database to retrieve and send data.**

[Video: Airtable tutorial: connecting a PandaSuite app to an Airtable base to retrieve and send data](https://www.youtube.com/embed/YWUIBfn-ylU?&hl=en&cc_lang_pref=en&cc_load_policy=1)

[Template: Airtable Animal Quiz](https://pandasuite.com/dashboard/use-template/VVJDhowB5IBMJWwgs5Fd)

## Create a free account on Airtable

[Airtable](https://airtable.com) is a well-known tool that combines spreadsheets, databases, and project management. It allows you to manage a wide range of data types, not just numbers: phone numbers, dates, barcodes, photos, etc. Its simplicity, intuitive interface, and free plan make it a key tool in the no-code ecosystem.

To create a free Airtable account: <https://airtable.com/signup>

## Prepare your Airtable database

Create a new database by clicking **Add a base**.

Structure your data within a table by adding *fields* for each type of data.

Here is an example of a real estate database:

[Image: Airtable base “Pandimmo”: a real estate table with Name, Description, Image, Address, Price and Type fields]

You can choose from different field types: checkbox, text, date, image, etc.

[Image: Field type list opened on the Image field in Airtable: single line text, long text, attachment, checkbox, date…]

Import your data manually or from a .csv file, Microsoft Excel, or Google Sheets:

[Image: Airtable “Add or import” menu to import data from a CSV file, Microsoft Excel or Google Sheets]

> **Info**
>
> For more information on Airtable, check out the help center:
> <https://support.airtable.com/>

## Create a personal token

> **Warning**
>
> Since 2024, Airtable has enhanced its security rules, requiring a personal
> token for API connections.

To create a personal token:

- Go to your Airtable account's token section: <https://airtable.com/create/tokens>
- Click **Create token**
- Define a **Name**, a **Scope**, and associate a database.
- Regarding **Permissions**, choose based on your needs:

  - If you only need to retrieve data, select **Read**.
  - If you need to both retrieve and modify data, select **Write**. In this case, protect the token using the proxy mode (see below).

[Image: Airtable personal token creation page: name “My token”, data.records:read scope, an associated base and the Create token button]

- Your personal token is now ready. Copy and store it in a secure location.

[Image: Airtable “Your token has been created” window: the token, blurred here, is shown only once and can be copied]

## Configure the HTTP component

Connect your Airtable database to your PandaSuite application using the HTTP component.

To configure your HTTP component:

- Select your **Project**: placing it here makes it accessible throughout your application.
- Click **Components** > **HTTP** to insert it.

[Image: PandaSuite Studio with Project selected: the HTTP component Airtable18025 appears in the object list, its properties on the right]

- To enter your Airtable base properties, go to **HELP** > **API Documentation** in Airtable to retrieve the API parameters.

[Image: Airtable HELP panel opened over the base, with the API documentation link at the bottom of the additional resources]

### URL

To retrieve the API URL, select your **Table** on the left and click **List Records**.

[Image: Airtable API documentation on List records for Table 1: the example curl request contains the API URL to copy]

Copy and paste the API URL. Here is an example URL:

```
https://api.airtable.com/v0/appIGPMYLUbwWCCbZ/Table%201
```

[Image: HTTP component properties in PandaSuite Studio: the URL field, highlighted, contains the Airtable API URL]

### Personal token

There are different ways to add your personal token based on access permissions.

If your token is **READ** only:

- In the **Header** field, click **+ Add**.
- Add **Authorization** as the key and **Bearer TOKEN** as the value, replacing TOKEN with your personal token.

[Image: Header field of the HTTP component in PandaSuite Studio: Authorization key and Bearer value followed by the token, blurred]

If your token is **WRITE**, it should not be exposed to users:

- In the **Authorization** field, select **API Key**.
- In **Value**, enter the TOKEN: **Proxy mode** will activate automatically, securing the token by using PandaSuite’s servers as a reverse proxy.

[Image: Authorization set to API Key: Authorization key, masked token as the value and Proxy mode turned on automatically]

### Method

To retrieve data, select the **GET** method. To send data, select **POST**.

### Cache management

Caching allows efficient reuse of previously retrieved API data, even when offline.

Choose from the following options:

- **No cache**: The app makes a network request without reading the cache.
- **Cache first**: The app first checks the cache before making a network request.
- **Network and cache**: The app returns cached content but also makes a request to update it, ensuring a fast response.

The **Persistent cache** option keeps the cache even after the app is closed.

## Use cases

### Display Airtable data in your application

#### Test the request

Double-click on the HTTP component.

Click **Test Request** to send a request.

Ensure that data is displayed correctly.

If raw data appears, the API is correctly configured. PandaSuite Studio will then allow you to display this data using the Data Binding explorer.

[Image: Component connected to Airtable after Test Request: the JSON returned by Airtable, with the first record and its fields, framed; token masked]

#### Display data dynamically with data binding

Add a [Collection](https://docs.pandasuite.com/essentials/data/collection/) component to display the data dynamically.

Bind the data source to your HTTP request.

Customize field displays based on your layout using [data binding](https://docs.pandasuite.com/essentials/data/data-binding/).

> **Info**
>
> 💡 Use variables to [dynamically
> filter](https://docs.pandasuite.com/essentials/data/filter-a-collection/) data and enable real-time
> search.

#### Handle pagination

Airtable displays at most 100 records per page.

Add an offset parameter to the URL to load the next pages.

> **Info**
>
> This is also where you can set up pagination. Airtable limits results to 100
> per page, but you can easily remove this limit. Learn more: [API
> pagination](https://docs.pandasuite.com/essentials/data/handle-api-pagination/).

### Send data to Airtable

- Change the method to **POST**.

- Check the parameters Airtable expects in **HELP** > **API Documentation**.

- In **Content Type**, choose **JSON**.

- In **Content**, you can build the content in the component or use **View JSON** to make it easier.

[Video: HTTP component set to POST: JSON content type, a sample Airtable record pasted into the JSON View, then a field bound to a data value]

- Don't forget to add a **Start request** action on the HTTP component.

If everything is correct, a new record will appear in your Airtable base.

Here is a template that shows how to send data to Airtable:

[Template: Incident Reporting Form](https://pandasuite.com/templates/incident-reporting-form/)
