Filtering Data off Airtable/Set Viewname to

Hiya!

I’m working on a hospital appointment manager app for school. I’m using airtable for the back end.

On airtable I have a patient table, and an appointment table. The appointment table is a list of all the available appointments, with each appointment being linked to a patient by means of the patient ID (primary key).

I have been trying to use list viewers to list the dates and times of all the appointments by patient ID. I have tried using the ‘temporary list’ method but to no avail (screen remains blank when I run it), and I’ve also tried using the ‘change view’ feature for airtable (to pull pre-filtered data directly from airtable), but the feature doesnt seem to work either.

Can anyone help please?

1 Like

You’ve explained the problem clearly but provided no examples of how you’ve actually set up anything. Please include screenshots of your blocks and/or a link to the project (and specify which screen you are referring to).

1 Like

Sorry about that!

Below are my blocks, and my sample table from airtable. The appointments table is a list of all the appointments.

…I followed this step by step: How to Add Data to AirTable from Your Thunkable App - YouTube


Those blocks look correct to me. Are you able to get individual values from that Airtable database from within Thunkable? That is, separate from your loops and just as a debugging step, can you access something like the ID value for the first row (819472M)? What about the Data/Time value for the first row (1/4/2022)?

So I tried the get cell function on a seperate screen just for testing…

When I run screen 2, it returns ‘úndefined’

maybe something wrong with API configuration?

1 Like

What happens if you try to get the cell value for row 1 of Patient_ID?

If that doesn’t work, double-check your Airtable authentication (see Airtable - Thunkable Docs).

It’s best to make sure you can get something really simply to work with Airtable (or any data source) before trying to do something complicated. Otherwise, you introduce too many variables that could be causing the problem.

1 Like

From your previous screenshots, ID is not a column in the table you are using. It is a reference column and Airtable treats it differently.

Use this block with a column from the table and it should work.

The other issue, you are using the Airtable component which requires the table name to be written as text in the component properties so make sure you spelled it correctly and using the correct case because it is case sensitive.

It would be better to use the Data Source connection to connect to you table because it is easier to test.

1 Like

This was my issue! Thank you so much!

I duplicated the Patient_ID column in Airtable, and changed the data format of the copied column to single line text, and managed to filter correctly.

My question now is, is there any way to convert the value in the reference column to a string to be used for filtering within thunkable?

1 Like

To see how Airtable treats referenced column you need to obtain a row as a JSON object and then use the reference to get the data of that column.