# \[Solved\] Retrieve data from Airtable based on condition

**URL:** <https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [May 30, 2018, 12:21am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281 "2018-05-30T00:21:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [May 30, 2018, 12:21am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/1 "2018-05-30T00:21:09Z")

</div>

Hi All

I have a simple app that allows users to data to airtable - it also uses google fire base to provide sign in authentication from them.

They can then view that data submitted

However I would like to be able to pull back only specific rows of data from airtable based on the users login,

Does anyone know a way o could achieve this alternatively each time they submit I could add an identifier but I’m not sure how I’d do this,

Any suggestions?

---

<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:** [May 30, 2018, 5:51am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/2 "2018-05-30T05:51:27Z")

</div>

Hi Jacob111,

There is a login (unique) and password from the user. The easiest way is to filter the data: load all the rows from AirTable to list and then in a cycle to select data from list that matches the login field. Why do you need an identifier if there is a unique login?

What specifically causes difficulties for you?

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [May 30, 2018, 6:03am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/3 "2018-05-30T06:03:54Z")

</div>

Hi actech,

Thank you! The reason I need a unique identifier is because several people with one unique identifier will see certain information, while other people without that identifier won’t, I need to be able to seperate this data across people dynamically,

Does this make sense?

Thanks again  
Jacob

---

<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:** [May 30, 2018, 6:07am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/4 "2018-05-30T06:07:49Z")

</div>

So can make one public login like “user”?

And is it suitable for you when you use public free admission? If user registered and have a login - we show one, and for unregistered users - another.

---

<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:** [May 30, 2018, 6:35am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/5 "2018-05-30T06:35:25Z")

</div>

When the user successfully enters via Sign In, the block returns userId. It can be used in AirTable.

![1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/d/6d785bec81e75b817ab33c01a31d1ca19b077e55.png)

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [May 30, 2018, 6:51am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/6 "2018-05-30T06:51:07Z")

</div>

Thanks actech, but the unique identifier can’t be different for all,

For example I have 7 people from one company, they should only see what is submitted in Airtable by people in that company,

So I’d like to make it dynamic in airtable, I still don’t quite get how userid could help in this situation?

Thanks  
Jacob

---

<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:** [May 30, 2018, 6:59am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/7 "2018-05-30T06:59:53Z")

</div>

Now I understand. Then you need to supplement the entry with a unique company ID. In our country it is an INN (a unique identifier of the taxpayer). When a user registers he enters INN and the program checks whether there is a company with such a INN or not.

Authorization of the company is a complicated process. Everything depends on the level of information secrecy. These are already issues of data security. Someone from 7 users can give their friend a login and password.

I think it’s more practical for you to issue a company ID. Then the user will enter not his login, but the login of the company.

---

<div class="post-metadata">

**Author:** ![Guido\_Esser](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Guido\_Esser](https://community.thunkable.com/u/Guido_Esser)\
**Post date:** [June 10, 2018, 7:50pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/8 "2018-06-10T19:50:33Z")

</div>

What about creating an extra table “user\_company” with columns user and company. Then get company from the user on login.

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [June 10, 2018, 10:21pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/9 "2018-06-10T22:21:44Z")

</div>

Jacob,  
I also need to retrieve a specific record (all columns) from my Airtable; I can use a key (email example) but between Spreadsheet GET component the only filter is the ROW.  
How I can know the row of a specific record?

I read actech answares but I do not understand how to do it.  
Many thanks  
Andrea

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [June 10, 2018, 10:30pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/10 "2018-06-10T22:30:05Z")

</div>

… same problem if I have to update a single field of a single record … I have to point the record with a key and then update the field.

How I do that?  
Many thanks  
Andrea

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [June 11, 2018, 12:38am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/11 "2018-06-11T00:38:41Z")

</div>

Hi Guido/Andrea,

It sounds as though you have similar problems. I wasn’t able to pull back on individual emails - but I could do it with one username and one password per company using google firebase and the “sign-in” component - please let me know if this suits your needs and I can assist

Thanks  
Jacob

---

<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:** [June 11, 2018, 6:11am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/12 "2018-06-11T06:11:41Z")

</div>

Hi,

What is specific about your complexity?

You can filter entries from AirTable by any number of any fields. Also each record initially has a unique identifier in addition to which you can create your own fields with unique values.

To solve such problems, you first need to create a general scheme MVC (Model-View-Controller) on paper. Then it becomes clear what data and where to use, how to show them and how to link the data in the table with their display in the application.

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [June 11, 2018, 4:26pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/13 "2018-06-11T16:26:34Z")

</div>

Ciao actech,  
no problem to select a single record pointing the row number … but how do I know what the number of records is?

for example … I have a address table with email in key … I need to get just one record that have a specific field data so …  
Maybe you say to parse all record filtering? could you show me a block ?

Thanks thanks  
Andrea

---

<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:** [June 11, 2018, 5:05pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/14 "2018-06-11T17:05:50Z")

</div>

Hi,

First of all you need to get all records from a table in a list with a block of “getAllRows”. After that, local storage will contain all data from the table and they can work on any screen. List filterList stored filtered on two fields a “email” field and Age. This list is assigned to the ListViewer and it displays only the values for the field Name (values of \_id non visible). Selecting from the list with the value of the Name field is also a unique key of \_id entry in which the entry can always be found.

 ![getallrows](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/9/f92fe6098d63d93b26cca6121b73769b94109f9e.png)

Working with the list of records is less effective than database queries. But the algorithm shown is universal and requires only one query to the database to retrieve data. After that you can do with the data whatever you want.

---

<div class="post-metadata">

**Author:** ![HEHEHE](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@HEHEHE](https://community.thunkable.com/u/HEHEHE)\
**Post date:** [September 11, 2018, 9:39pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/15 "2018-09-11T21:39:59Z")

</div>

By clicking what, you got “join” in if else statement of your png

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [September 12, 2018, 12:04am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/16 "2018-09-12T00:04:41Z")

</div>

You can get the “Join” block from “Text” Blocks as below

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

---

<div class="post-metadata">

**Author:** ![HEHEHE](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@HEHEHE](https://community.thunkable.com/u/HEHEHE)\
**Post date:** [September 12, 2018, 9:02am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/17 "2018-09-12T09:02:04Z")

</div>

![Screenshot_2018-09-12-14-24-10-568](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/5/c587afdaa3d6f902f125b453603c03d35e12fe23.jpeg)  
Ok ?  
Now I will remove 2 string ones  
This is what I get

 ![Screenshot_2018-09-12-14-24-57-876](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cda809d16bc5f25c4d1918b26e5704133dd0ec0e.jpeg)  
Now I will go to settings of join and remove 2 items  
 ![Screenshot_2018-09-12-14-25-17-012](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/a/7a3cdfe463078334702904b40af272676b8eb38e.jpeg)  
 ![Screenshot_2018-09-12-14-25-44-347](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/a/fa7a40582600f9f4ddd62b5082dc8015ab33e32e.jpeg)  
Finally what I have got is only this ![Screenshot_2018-09-12-14-25-55-280](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/4/6466c79241091748adde9aac35255a8a4266656e.jpeg)  
Can you please tell where am I missing ?  
What I want is this ! ![Screenshot_2018-09-12-14-37-23-544](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/d/9dfa98b609c40de007b5c4c4c6ae80e579c170a1.jpeg) join

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [September 12, 2018, 12:50pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/18 "2018-09-12T12:50:12Z")

</div>

You must keep one “item” block in the “join” block so only remove one and you will get the required block.

---

<div class="post-metadata">

**Author:** ![HEHEHE](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@HEHEHE](https://community.thunkable.com/u/HEHEHE)\
**Post date:** [September 12, 2018, 2:15pm UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/19 "2018-09-12T14:15:55Z")

</div>

Ok got it thankyou

---

<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, 11:02am UTC](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281/20 "2021-01-08T11:02:37Z")

</div>

hi actech,

i have few questions regarding your solution:

in your solution you copied the rows from the DB to the list “filterList” 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

[Next page](https://community.thunkable.com/t/solved-retrieve-data-from-airtable-based-on-condition/29281.md?page=2)
