Hi,
Retool's built-in filtering for table is great but they are baked into the table. When we have some complex queries to generate the table (and there are many) is there any way we can implement that same incredible searching from other UI for example a text box ? is this even possible to achieve ?
I have moved on from using setFilter() and now do all of my filtering using JSON with SQL queries.
I use a query to get all of my records as you normally would (say qryPossibleVenues).
Then I create a JSON with SQL query can call it something like qryPossibleVenues_Filtered and use that as the source for my table.
You can then do pretty standard Where clauses to do you filtering
select * from {{qryPossibleVenues.data}}
where (({{selFilterLeg.value || null}} IS NULL OR leg={{selFilterLeg.value}}) OR ({{selFilterLeg.value || -1}} = -1 AND leg is null))
AND ({{selFilterStatus.value || null}} IS NULL OR status={{selFilterStatus.value}})
AND ({{txtFilterVenue.value || null}} IS NULL OR name like {{'%' + txtFilterVenue.value + '%'}})
AND ({{swHideDeadVenues.value || false}} = false or not status=5)
Hey Mathews ,
you are a life saver. Now I was trying to use JsonQL first and pretty sure saw documentation but could not figure out how should I update my table with the result. As you mentioned the trick is to use the filtered query as source.