Can I have the user choose to read a Google sheet?

I have good success reading in data from a Google Sheets data source in Thunkable X. Thank you for that very useful feature!

I’m wondering if a user can tell the app what Google Sheet to read data from. So, for instance, Joe User uses some widget to tell the app to open a Sheet from his Google Drive, and Sue Otheruser can open a Sheet from her Google Drive, and so on. Is there a way to do this?

I second this question. That way Joe user controls his/her data without other users seeing it.

Yes. Use the google sheet app.

As far as using this as a database, you should have some way to link the user to any given record. Most commonly this will. Be the Firebase userID. That would be a field in the table. The. You filter any records not pertaining to that user in the search and retrieval phase.

1 Like

(Sigh. Tried to edit and accidentally withdrew instead.)

I’ve been thinking about my question some this week, trying to figure out how to execute a project where it might make sense to read a bunch of data from an existing user-owned google sheet. Yes, I know, it’s a weird case, but I’m thinking about importing from a google sheet (user-specified) into the app, so maybe it sort of makes sense. I’m not proposing to store each user’s app-generated data in a different sheet. That’d be silly. :slight_smile: But as the user, I’d much rather tell the app where to slurp the data from than retype it on my phone, for sure!

There is a Google sheets API, and Thunkable can make an API call. I suspect that means the answer to my question is yes, but you’d have to do a lot of work to make it happen, rather than just adding a data source and using the built in data source blocks. Maybe that’s not worth it.

I haven’t found way to programmatically add a data source using the built-in blocks (without making API calls and parsing json), but if I’m wrong, I’d like to know!