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

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

the airtable i am working in

Preformatted text

this is how i query the data using google sheets.

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

An example of filtering is given on the scrAirTable ACtech demo project
screen when you click on the Filter button.

https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/

Best regards, Alex
ACtech demo project
Thunkable X Basic Programming Course
Block Reference
Component Reference
Bug tracker
Polipaint
Map canvas
Method Inspector
Performance

1 Like

@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.

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?

изображение

1 Like

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

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

6 Likes

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