Filtering a table

Hi, I'm a total noob so apologies if I'm missing something obvious.

I'm creating a small app which pulls some data from a google sheet however I want to make the table filter so rows only show if it says 'True' in the visible column. How on earth do I do this?

The idea is that when a user hits the 'delete' button it makes the row disappear from the table, but doesn't actually delete the data from the spreadsheet.

Make sense??

Thanks for the help!!!

Peter

Hi Peter! Welcome to the community :slight_smile:

Do you want to try out our table filter tutorial: Retool Table Filter Tutorial for SQL Beginners ? That should help explain how to set up filters for table data in more detail for you and hopefully make you feel more confident with some features in Retool.

The way we do it in there is adding a 'Query JSON with SQL' query to filter according to values set by dropdowns/inputs etc, but you could also code the fixed condition in.

For you it might be something like:

SELECT * FROM [yourquery]
WHERE visible = true

but note that Google Sheets values can behave a little differently, so you may need to use quotation marks around the column header and/or boolean.

Do you think having more filters would solve your 'delete' issue, or do you still want that button to delete rows from the table? If so, you could set up another 'update a spreadsheet' GSheets query which will update the 'Visible' value of the selected row (use table.selectedRow) to FALSE, something along these lines:

We also have more tips in our buttons UI tutorial that may help with your app later on! Shout if you need a hand with anything else :slight_smile:

1 Like

Thanks Sophie.. With a bit of tinkering this worked perfectly!

I was sort of doing it right already but what I didn't realise was that 'true' needed to be 'TRUE'.

1 Like