# \[Solved\] How to query and filter data from airtable?

**URL:** https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045
**Category:** Questions about Thunkable X
**Tags:** airtable
**Created:** [December 14, 2019, 9:12pm UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045 "2019-12-14T21:12:33Z")
**Posts on this page:** 7
**Page:** 1

<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 14, 2019, 9:12pm UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045/1 "2019-12-14T21:12:33Z")

</div>

This has been asked in the past but I did not find an answer that helped so I am hoping someone can help me construct the blocks.

I am wanting to query some data from airtable however, I have many users data coming into the same table because they all use the same app. (no duhh!)

I want to be able to call specific rows based on qualifiers from 2 columns the UserName and TypeOfData.

from those row I want to get data from the behavior counts to create 3 lists of data to be used as paired coordinates to make a chart. I am not sure what blocks to use to do this. Can anyone help.

for example a query may look like: if Client Name=(jared@jaredgibb.xyz) and data type = (count) produce 4 lists separated by the comma delmiter , list 1=dates, list 2=behavior count 1, list 3= behaivor count 2, and list 4 = behavior count 3

Currently I do this by having the user save data both in LocalDB and airtable. this poses issues if there is data recorded that isnt ‘good’ data and needs to be recorded. The graphs will not be accurate so i have the airtable option as a backup. I also currently do this for the users using google sheets and Integromat to transfer all of my data but this is very ineficient and costs more than it should (especially if i can include this into the app)

I will include a link to my app and some clarifying screenshots.  
the app: [Thunkable](https://x.thunkable.com/copy/b76e38d8164b9e67fb52aeed3d440937)

the airtable i am working in

> **[Grid view - Airtable](https://airtable.com/shr3zJ9IUCHnc6u6q)**
>
> Explore the "Grid" view on Airtable.

 ![Screen Shot 2019-12-14 at 3.58.00 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/b/cb8bdf9456bb6fa590ae6a56fd04de120254e5c2.png) `Preformatted text`  
 ![Screen Shot 2019-12-14 at 3.48.29 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/9/0982510e8e8e0a7b49921dd57e1aa63c205625b6.jpeg)

this is how i query the data using google sheets.

 ![Screen Shot 2019-12-14 at 3.48.15 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cd52d32e496d99ce8100cb075e89f3d9600d8096.png)

this is how i query data for my graphs using local db

 ![Screen Shot 2019-12-14 at 4.14.57 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/9/594d43f77a2af3e27b7751a9602bdb5ae4bb4a36.png)

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [December 15, 2019, 7:54am UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045/2 "2019-12-15T07:54:52Z")

</div>

An example of filtering is given on the scrAirTable [ACtech demo project](https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/)  
screen when you click on the Filter button.

[https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/](https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/)

Best regards, Alex  
[ACtech demo project](https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/)  
[Thunkable X Basic Programming Course](http://droidscript.ru/main/title_ds15.php)  
[Block Reference](http://droidscript.ru/main/statyi/thunkableios_blockhelper.php)  
[Component Reference](http://droidscript.ru/main/statyi/thunkableios_objects.php)  
[Bug tracker](https://x.thunkable.com/projects/5dbd5243a77acad1b26f851f/project/properties/designer/)  
[Polipaint](https://x.thunkable.com/projects/5db56632a1e1fcefd3932db7/project/properties/designer/)  
[Map canvas](https://x.thunkable.com/projects/5db56eadb7c037443fadb222/project/properties/designer/)  
[Method Inspector](https://x.thunkable.com/projects/5d9310fcdf0a8f208bd2bb11/openProject/designer)  
[Performance](https://x.thunkable.com/projects/5db93ebab8e0fc9c685b3477/project/properties/designer/)

---

<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 15, 2019, 2:03pm UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045/3 "2019-12-15T14:03:23Z")

</div>

@actech Thank you! I see how to filter the results by one qualifier. for example ‘name’. The app appears to filter only based on the first colum of data but what about if needed to filter by two columns of data. for example: ‘name’ and ‘activity’ thereby allowing the app to GET specific data from that user while doing that activity

the columns would be set up something like this:

Name, date, activity, activity 1.A score, activity 1.B score, activity 1.c score, activity 2.B score, activity 2.b score,

what happens when the user uses the app is that in each row, the user will only record data for 1 of the two activities. within each activity, there are 3 data points collected.

I want the app to be able to GET a list of dates and data points for each activity completed (either 1.A, 1.B, 1.C OR 2.A, 2.B, 2C) which data retrieved would be dependent upon the ‘activity’ variable

Currently I accomplish this task by using 3 localDB’s in the app thereby removing the need to filter data.

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [December 15, 2019, 3:13pm UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045/4 "2019-12-15T15:13:46Z")

</div>

> I see how to filter the results by one qualifier.

Shown below are the blocks in which filtering takes place over two fields. Or are you talking about some of my other blocks?

 ![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/7/47bab681d77e4147685d087ca86f00fc83f8cecd.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 20, 2019, 3:20pm UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045/5 "2019-12-20T15:20:18Z")

</div>

I finally saw the solution after studying this over a few days! Thank you so much!!!

Here is the old code where i got data from the LocalDB  
 ![Screen Shot 2019-12-20 at 10.08.05 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/3/03b5ab43e388483bafafb0f4bf89c9bd688950bd.png)

and here is the new code where I retrieve the same data from my AirTable database!

 ![Screen Shot 2019-12-20 at 10.09.26 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/1/b17d648bbae4053613eace65939b5f2614054b46.png)

---

<div class="post-metadata">

### Author: ![adwise.mtjp](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@adwise.mtjp](https://community.thunkable.com/u/adwise.mtjp)
#### Post date: [January 8, 2021, 2:20pm UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045/6 "2021-01-08T14:20:35Z")

</div>

hi jared,

i have few questions regarding your solution:

in your solution you copied the rows from the DB to the list in the local memory of the app. how do you initialized that local list? how to determine the number and the type of the columns?  
what if i manage my DB in airtable and i store pictures there, can this script copy those pictures to the local table?

as i understand, instead of insert hardcoded email address, with the sign in we can store the email of the user in global variable and use that variable in order to retrieve the relevant data?

thank you

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 11:46am UTC](https://community.thunkable.com/t/solved-how-to-query-and-filter-data-from-airtable/368045/7 "2024-11-08T11:46:17Z")

</div>


