First let me acknowledge I’ve only been working with Thunkable for a little over a month. And I’m not a coder, so this solution is one I’ve worked out myself by experimenting.
I have a similar need to find a value in a column in Airtable, and then get the value from the same row in a different column. I also need to get the entire row.
My solution looks like this:
- download the whole sheet from Airtable into a variable
- create a list for the column that contains the value you want to find
- create a list for the column that contains the value you want to get
To create these lists I did this:
- make two empty list variables (to hold the two columns of data) - eg NumberList and StatusList
- get the list of properties of the downloaded object (in my case a list running from 0 to (last row no minus 1)), each of these properties is an object that contains a row from the sheet. Store this list in another variable (eg PropertyList)
- using the name of the find-in column “Status”, in each row get the property “Status” and add it (as last) to the list StatusList
- using the name of the get column “Number”, in each row get the property “Number” and add it (as last) to the list NumberList
- I also find it useful to look up a third property “_id” which returns the unique Airtable record id for the line in the database. I store this in a variable called, for example, Rec_idList.
You can then search the status list, return an index that matches the value you want to find, and then use the index to find the matching value in the other list. Your situation is different to mine in that I’m searching for a unique value in a list, yours repeat so you’ll need to adapt this method to allow for that.
Note also that empty cells can cause this method to fail, so if there might be empty cells you’ll need to protect against that - by checking if a property exists before adding it to the list, and if it doesn’t writing “no value” for example to the list. Your two lists have to be the same length and in their original order for this approach to work - if you sort one this method will fail. Hope this helps. Here are some examples from my project:
This is the main block where the lists are set to empty, the data sheet is downloaded, and the lists are created using my ListOneProperty function -
This is my ListOneProperty function -
This is my GetMyProfile function, which essentially finds a line in the the data sheet by searching for an entry in one column, and then saves properties from that line to specific variables -
There are many more steps to this than I imagined I’d need!
A webAPI data query would possibly be simpler but I don’t know how to do that.
Also Airtable limits calls to the database to 5 per second, which is why I went with downloading the whole sheet and manipulating that data in the app.