The controls for loading gsheet data don’t have an option to query based on a condition. Like the demo video, I want to be able to filter the gsheet data according to user input. All the controls related to gsheet are fixed
Hey @carlos-a what do you mean by controls? Have you been able to get your GSheets data into a Table
component? We have a guide to working with tables available here
Is there a way to do a Select statement in here?
@carlos-a totally! You have two options here:
- You can pull the data into a table and use table filters (the little filter icon)
- If you save your query (
query1
) that pulls the sheet's data into Retool, you can create another query that uses SQL to query that. Create a second query and as your resource (from the resource dropdown) chooseQuery JSON with SQL
. In that query window you should be able to run something likeSELECT * FROM {{ query1.data }}
Let me know if these help!
Awesome, thanks!
@justin option 2 there was an awesome find for me yesterday. But now it's left me trying to join this google sheet query with a MySQL query. How would I call the already run MySQL query? This is what happens to me thus far...
Hi @bryan!
Try writing {{ formatDataAsArray(ma_schooldb.data) }}
query data exists either as an object of arrays (where each key corresponds to a column name and its value is the data for that column) or an array of objects (where each object in the array corresponds to a row). The functions formatDataAsArray
and formatDataAsObject
let you convert between these two! In this case, Query JSON with SQL is expecting an array of objects.