How can i change Data viewer's datasource or table by code?

Hi guys! I LOVE the new data viewers component. I’m making an app with more than 250 different datasheets. This is what i want:

-When button “Cookie” is pressed --> Set Data_viewer_list/grid datasource to “Cookie”
-When button “USA” is pressed —> Set Data_viewer datasource to “America” AND set Data_viewer selected table to “USA”
-When button “Dog” is pressed —> Set Data_viewer selected table to “Dog”

Is there a way to achive this? I didnt find any smart solution.

My solution is to use 250 (!!!) different Data_viewer (with different datasource/tables) and use visible/not visible propriety but i think is not the optimal solution.

I’m making this question because I saw that i can use the ANY component to create/Delete Data_viewer list/grid by code. How can i manage them and change their proprieties by code?

I’m using airtable right now, but i can change it if necessary to achive my pourpouses.
Thank you!!

Hi @Lorenzo_Rinaldi,

This isn’t quite possible. I haven’t been keeping up very much with the progress of this component, though there is a topic created on the Data Viewer in community, you might get some luck with an answer there.

Another place to try having a look is Thunkable GitHub. If you see the feature requested, give it a +1 or a comment saying you’d like this too, or if you don’t see it you could create a feature request :slight_smile:

A temporary solution to this for you could be to use cloning and have all the data in one spreadsheet (sort it by a tag). This is kind of like a DIY list, which you have full control over. It is slightly more limited than a real list as sometimes when cloning a lot of items, lag may occur, so be weary of that. This would only work with Airtable or the in-app Local-DB, as Google Sheets is currently exclusive to the Data Viewers.


Thank you for you answer. I need more than one big spreadsheet because a lot of people are working in this project with different software/settings and we update data more than twice a day. It’s really hard to collect all this data and paste it in a big datasheet every time. I will try to sumbit my request in the Github, thank you!

1 Like