Ability to specify a local table data source based on a value

I am making an app to plot a child’s height, weight, etc. based on a number of reference growth charts (about 30 in total). For each chart, I have a table in a local data source. I’m trying to avoid AirTables and Google Sheets to keep things simple, which is probably my problem here. Each table has like 20 rows and 8 columns, and I need all the data from the table for each kid, since I’m recreating the entire growth chart with 7 percentile curves and then plotting the kid’s measurements on top of that (see image, hope that makes this understandable).

What I would like to do is have the user specify which reference they want to use (based on sex, age range, height or weight, etc.), store that as an app variable ChartDesired, and then using that variable to specify which table to get to plot that chart.

The problem with the Local Data Source blocks is that the Table Name and Column Names are hard-wired (which makes them super-handy when you are using only a few tables). Because of that, you cannot e.g. do a loop to get the results for Column 1, then 2, etc. Only the rows can be specified with a variable.

I can transpose the data to make columns into rows, but that doesn’t solve the problem perfectly. Of course I can make a huge If/Then block for all the ChartDesired variables and read each row in that table to a list, but that is going to mean like 25 blocks per chart,

Or I guess I could put all the data for 30 charts into one table, but that still isn’t perfect.

So maybe this is a feature request to make Local Data Source blocks where the Table Name and Column Names can be specified with a variable?

Anyone have a solution that’s more sensible? Thanks!

Can you show examples of the tables?

It’s a very simple table with the data points for the 7 percentile curves in the chart, basically one column for the x-axis and 7 columns for the various y axes. It’s based on the attached csv.
turner1.csv (892 Bytes)

I would use Firebase because:

  1. The confidential data would be secure.
  2. You can add as many records as you want without needing additional “tables.”
1 Like

Yes, I know I could use that or AirTables or Google Sheets, I was just looking for something simple that was on the phone. But I suspect I will have to go with something online. Still it would be nice to have a Thunkable block to make this easier.

So I decided to break down and use Airtables. I added a base using OAuth (since the API key thing is going soon), but then I see that instead of the old Airtable blocks, I get exactly the same blocks as for a local data source, with the inability to use a variable to define the Table Name, the Column Name. So really not so helpful.

I will also say that Thunkable now has two web pages on how to add an Airtable, the old one with API-only and the new one with API and OAuth. Super-confusing.

I use Xano as the back end database and use local tables to populate DVLs and a few other tasks like populating labels in that preferred language of the user. Otherwise all data storage and queries are handled on Xano.