How to Fetch Employee Name from Airtable, based on Employee Number

Hi,

This is my second day in the community and i am getting stuck in lots of places. Seek your helping guidance to overcome certain challenges i am facing (though i know it’s a silly one)

I have created a User Database in Airtable which has multiple line of unique user records.
When the user log’s into the Mobile App with valid credentials, the user is guided to a Welcome Page.

This Page is intended to show "Welcome ", for which i have stored the Employee Number in a textbox using TinyDB, however i am unsure, how to fetch the User Name from Airtable.

Can someone please help/guide me how to fetch from Airtable by referring to the Employee Number?

image

You can try it like this -
The Employ number which you are using ( for example 123456789 ), take it’s last 1, 2 0r more digits, in this case let the last one which is 9.
Assign that number ( 9 ) as user Row Number in Airtable which contains all data of him.

This way only his Row will we called and you can use whatever information wherever you are willing to.

Hi Addylin,
Sorry, could you please guide me with the block snapshot.
I am looking for something like (select NAME from EMPLOYEE where EMPID=12345;)

Regards,
Sribatsha

You would like to use MySql.

Hi,

No i am using Airtable for storage, want to know how the query can be arranged in blocks.
It is just like fetching information from the table, based on the logged in user.

Regards,
Sribatsha

Can you show the structure of your airtable ?

1 Like

Hi @dora_paz,
Sharing herewith the Airtable Information.

Regards,
Sribatsha

Try something like this

4 Likes

Hi @dora_paz,
Thanks for the guidance.
Being new to the area, i was trying to understand the flow of your blocks.
I can understand that the first few blocks, you are getting the values “Name” and “Register Number” from the SpreadSheet1 and loading into the global variables “name” and “Register_Number”.

Could you please help me understand the functionality of the block “for each number”
image

Though i am trying to fetch it from the internet as well, however, will appreciate, if you can please clarify.

Regards,
Sribatsha

Hi @dora_paz,

Thanks for the guidance, however the solution doesn’t address my requirement.
I tried creating the blocks, however the result always displays the NAME of the record which comes from the length (so as for now, there were 2 records based on my Airtable, hence it shows me the name of the second row, although the Registrar Number field displays from first row)
i.e. Registrar Number = 12345
Name Displayed based on block = Tridip

Regards,
Sribatsha

Actually I had an error in my code , :blush:

Try

1 Like

Hi @dora_paz,

Thanks a lot, it worked :slight_smile:
But i am still trying to understand the logic :smiley:

Regards,
Sribatsha

1 Like

I have a list with 3 registered numbers in my airtable so the lenght of my list in that case is 3. What the loop does is from 1 to 3 (length of my list), one by one, if select item in list index 1 checks if condition is true, then checks item in index 2 and finally in index 3

see images below to understand it

2 Likes

Hi @dora_paz,

Appreciate your help in clarifying the doubt. :+1:

Regards,
Sribatsha

1 Like

Hi @dora_paz,
Thanks for your help and guidance.
I was able to achieve my requirement by adjusting the blocks in a different way.
Could you please guide me, if its Fine, or if i am missing any best practice.

Appreciating your help.

Regards,
Sribatsha

Yes I believe it will work fine. Glad to see that you modified the code according to your needs :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.