# The AirTable API (a more efficient way to integrate AirTable with Thunkable)

**URL:** <https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167>\
**Category:** Tutorials and DIY Guides\
**Tags:** community, webapi, airtable, expert, tutorial\
**Created:** [December 4, 2020, 5:16pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167 "2020-12-04T17:16:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![darren](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren/32/69854_2.png) [@darren](https://community.thunkable.com/u/darren)\
**Post date:** [December 4, 2020, 5:16pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/1 "2020-12-04T17:16:52Z")

</div>

I’ve had the pleasure of working on a few AirTable projects recently.

One thing I’ve learned is doing stuff like this is inefficient once you start to get a lot of data.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/f/2f904519fd1693e9c20c1c97c6172d88d3d115d7.png)

You should try to limit how much data you call and the number of API calls. To update a record, you shouldn’t get all rows, loop through all rows until you find the row you need to update, then update that row.

With the AirTable API you can use things like `filterByFormula` to query the data in one call to reduce the data you are retrieving.

So in this video I demo the concepts of how to use the AirTable API. I will also share the set up and screen shots of the blocks.

_NOTE: This is an advanced approach._

### Tutorial

[![](https://img.youtube.com/vi/7LO80MCvYCM/maxresdefault.jpg "The AirTable API (a more efficient way to integrate AirTable with Thunkable)") ](https://www.youtube.com/watch?v=7LO80MCvYCM)

### Demo

> **[Thunkable](https://x.thunkable.com/projectPage/5fca598a8e5b21001263fad9)**

### Thunkable API Configuration

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/1/f122df913fbdf2a6a9a10eca6b2d4e06bb2e3e96.png)

### Create Record

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/a/3a08a22a27e6bfb68deef592ea619fcd91eebb21.png)

### Read Record (using filterByFormula)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/a/ca080316f036dc5a465d4187aae603b5a185bcda.png)

### Update Record (Record ID stored on data retrieval)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/e/ee0ae7841970aa3aafd543e99826c4ceb33d484a.png)

### Delete Record (Record ID stored on data retrieval)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/f/4fd8ca0db923fc6b10450be959a0e843c8d2de6d.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 4, 2020, 11:54pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/2 "2020-12-04T23:54:23Z")

</div>

Oooh… I think I just learned that I can use the Firebase API for making a PATCH call to update a particular child in the database. This should be very useful. Thanks, @darren!

> **[Firebase Database REST API](https://firebase.google.com/docs/reference/rest/database#section-patch)**

---

<div class="post-metadata">

**Author:** ![darren](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren/32/69854_2.png) [@darren](https://community.thunkable.com/u/darren)\
**Post date:** [December 5, 2020, 3:42am UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/3 "2020-12-05T03:42:32Z")

</div>

Great! Glad I could point that out. PATCH was recently added.

---

<div class="post-metadata">

**Author:** ![Dario\_Cappello](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@Dario\_Cappello](https://community.thunkable.com/u/Dario_Cappello)\
**Post date:** [December 12, 2021, 5:19pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/4 "2021-12-12T17:19:03Z")

</div>

Hello. I found this post very interesting. But I was unable to filter the data on 2 or more conditions? There’s a way?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 12, 2021, 7:07pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/5 "2021-12-12T19:07:09Z")

</div>

I’ve started using Airtable formulas to filter data. I create a view in Airtable with a specific column formula that I want and then add that view as a Data Source in Thunkable. The only (big) problem is that all of the views are named the same thing… the table base name.

But this allows me to sync Airtable with a Data Viewer List (DVL) whereas filtering by formula (below) doesn’t easily allow that.

If we could get these two issues fixed, it would be amazing:

> <https://github.com/thunkable/thunkable-issues/issues/1036>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> Airtable is …a great way to store data, especially data that includes photos like student photos and names for a student directory app. Data Viewer Lists/Grids (DVL/Gs) are a great way to display data from an external source such as Airtable.
> 
> So what's the problem? DVL/Gs sync up to Airtable but can only connect to one base with one custom view (optionally) at a time. So if you want to have separate screens or layouts in Thunkable, you have to have multiple DVL/G components and show/hide them constantly to show different data. An example of this might be to show a 3rd grade class OR a 4th grade class within a single screen based on a button click.
> 
> \*\*Describe the solution you'd like\*\*
> I'd like to have the ability to switch Airtable bases and custom views for a DVL/G using blocks. I know this is a big ask based on the way the blocks are structured with drop-down menus but it would make Thunkable so much more flexible and powerful for connecting to data sources.
> 
> \*\*Describe alternatives you've considered\*\*
> 
> \*\*Which platform are you asking for?\*\*
> Thunkable X
> 
> \*\*Additional context\*\*

> <https://github.com/thunkable/thunkable-issues/issues/1034>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> I'm designin…g an app that uses multiple custom views from Airtable. When I add a data source from Airtable and type in a custom view (by the way, it would be great to have a drop-down menu of custom views synced from Airtable rather than having to manually type in a correct custom view name), the data source just appears as the name of the base no matter what custom view I am using.
> 
> \*\*Describe the solution you'd like\*\*
> The custom view should be listed along with the base name.
> 
> \*\*Describe alternatives you've considered\*\*
> Advil :)
> 
> \*\*Which platform are you asking for?\*\*
> Thunkable X
> 
> \*\*Additional context\*\*
> Right now, all custom views look indistinguishable from each other:
> 
> \<img src="https://user-images.githubusercontent.com/10355498/136684449-4fdb60f0-b058-498f-805b-0a44a42ec368.png" width="300" \>

Beyond that, I’m not sure how to add multiple filter requests to an Airtable API call. Can you give an example of what you’re trying to do?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 12, 2021, 7:13pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/6 "2021-12-12T19:13:00Z")

</div>

Ah, you can definitely filter by formula using the Airtable API:

> **[How do I sort, filter, or retrieve ordered records in the API?](https://support.airtable.com/hc/en-us/articles/223247187-How-do-I-sort-filter-or-retrieve-ordered-records-in-the-API-)**
>
> To retrieve records in the same order as they appear in a specific table view, you can pass in the "view" parameter in the list records request (see the API docs).
> Additionally, you can filter and ...

So you should be able to do whatever you need since formulas can be very complex and use logical gates (AND, OR).

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 12, 2021, 7:15pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/7 "2021-12-12T19:15:14Z")

</div>

The Airtable API accepts `filterbyformula` as a `QueryParameter` field which you can use the same formula used for the `view filter`. Of course the problem then is to loop through the records and store them in a local table to show them using DVL.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 12, 2021, 7:16pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/8 "2021-12-12T19:16:54Z")

</div>

Yeah, just realized it really depends on whether or not you intend to use a DVL. I like my in-table view filtering for DVL support but the API filtering by formula could be used for many purposes.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 12, 2021, 7:22pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/9 "2021-12-12T19:22:52Z")

</div>

I use a different way of filtering. I would say a more dynamic filtering

I have a table `Students` which is connected to a table `ControlTable`

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/1/3194eb0482d5b25c1c652a64b770413a6601c54c.png)

All I have to do in Thunkable is to change the value in `ControlTable` which contains a single row. This will allow different records to be displayed from the `Students` table.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/c/dc2bb7be4d8e1992f892b4510772fef0197b2710.png)

If you compare this image with the one above you see different students because I use the `ControlTable` row to filter it.

Content of `ControlTable`  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/4/04cbd69ba07bc9219f47aec71caa3881bcabf83d.png)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [December 12, 2021, 7:25pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/10 "2021-12-12T19:25:52Z")

</div>

How scalable is this approach? If me and user C are trying to filter differently at the same time, will this work?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 12, 2021, 7:38pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/11 "2021-12-12T19:38:07Z")

</div>

> [@jared](#):
>
> will this work?

I’m not sure but I guess **NO**. This wouldn’t work if both users filter the same time. But I tested it in a table with over 600 rows and works very fast.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 12, 2021, 11:43pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/12 "2021-12-12T23:43:32Z")

</div>

I’d love to know a little but more about how you do this. When you say the tables are “connected” what do you mean? And how does the value in the ControlTable column achieve filtering?

**Edit:** Okay, I see how to link records from one table to another. How are you populating the student names in the “Students” column in the ControlTable?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 13, 2021, 9:48am UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/13 "2021-12-13T09:48:35Z")

</div>

When you choose to link your column to another record you choose this option  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/f/3ff303333b89d1ba10c8abf992e568a49b9d35cd.png)

The next step is somewhat not very clear, you need to link the new **column** you created with a **row** in the other table by choosing this  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/f/bf255f23ac0107968f92930be061c6246d6d31d9.png)

Select all that you want. For me I selected all rows in `Students` table.

The next step is to create another column which is a **formula column**.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b96439257e59fdb21302aabf020b948b4f5f9399.png)

This is the filter I used `IF(ControlTable=0,1,StudentGrade=ControlTable)`  
Which translates to  
IF the row in `ControlTable` contains **0**  
THEN show all rows  
ELSE  
show rows where `StudentGrade` column matches `ControlTable`

The last bit of the setup is to set the `Grid View` which is the default to filter on the **formula column**  
it worked for me.

---

<div class="post-metadata">

**Author:** ![Dario\_Cappello](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@Dario\_Cappello](https://community.thunkable.com/u/Dario_Cappello)\
**Post date:** [December 13, 2021, 10:41am UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/14 "2021-12-13T10:41:22Z")

</div>

I have a table that will contain many records in the future. With one condition I can filter, but I am not finding a way to insert the second condition. I need to filter on two fields and then save the data in the local list and then show them in DVL.

 ![Su post](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/d/0de90c24facc3a399e9b7477ccafcfe9c46df4d4.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 13, 2021, 11:23am UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/15 "2021-12-13T11:23:30Z")

</div>

The API does not allow more than one `filterbyformula` entry so you should join your both conditions in one entry.

Example: `({Num_Paese} = 48 and {Num_Categoria} = 20)`

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 13, 2021, 5:37pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/16 "2021-12-13T17:37:49Z")

</div>

@muneer… thanks to you, I was able to remove my three extra Data Viewer Lists and just have a single one that switches between filtered columns. It’s working great!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 13, 2021, 6:11pm UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/17 "2021-12-13T18:11:41Z")

</div>

> [@tatiang](#):
>
> It’s working great!

Welcome boss.

---

<div class="post-metadata">

**Author:** ![Dario\_Cappello](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@Dario\_Cappello](https://community.thunkable.com/u/Dario_Cappello)\
**Post date:** [December 14, 2021, 7:36am UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/18 "2021-12-14T07:36:34Z")

</div>

> [@muneer](#):
>
> ({Num\_Paese} = 48 and {Num\_Categoria} = 20)

I have already tried so many ways to do  
({Num\_Paese} = 48 and {Num\_Categoria} = 20)  
but it doesn’t work.  
Either there is a particular syntax (and I was wondering just that) or it is not possible to insert more than one condition.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 14, 2021, 8:33am UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/19 "2021-12-14T08:33:10Z")

</div>

Have you tried the AND formula that Airtable requires?

It is formatted like this:

**AND({Num\_Paese}=48,{Num\_Categoria}=20)**

If that still doesn’t work, this topic on another forum might shed some light on the issue:

> **[Filter (airtable populated) list by search term?](https://forum.adalo.com/t/filter-airtable-populated-list-by-search-term/2502)**
>
> I am starting to test out Airtable as a replacement for the Adalo database. Can anyone help with how to create a filter based on the search term value? I have a field that I have called “Search Index” with a handful of keywords in it. I want the...

(I’m not really sure how similar that issue is…)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 14, 2021, 9:00am UTC](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167/20 "2021-12-14T09:00:29Z")

</div>

Yes, @tatiang  
The same advice is in the Airtable community. See this post

> **[Filterbyformula in two fields](https://community.airtable.com/t5/development-apis/filterbyformula-in-two-fields/td-p/116462)**
>
> Hello, With the API custom with a filterbyformula, I would like to collect all record, corresponding to my needs, from two differents fields. “Conversation?filterByFormula=%7Bexpediteur%7D%20%3D%20%27${user.email}%27” Like, in this case i would like...

In the other hand,

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/f/af2ec93cb3b47e06e2d8ead04e3ad82fcee96f4e.png)

This shows that the numbers are keyed in as text and therefore the condition suggested by @tatiang

> [@tatiang](#):
>
> AND({Num\_Paese}=48,{Num\_Categoria}=20)

would read as

```auto
AND({Num_Paese}='48',{Num_Categoria}='20')

```

[Next page](https://community.thunkable.com/t/the-airtable-api-a-more-efficient-way-to-integrate-airtable-with-thunkable/1021167.md?page=2)
