Workaround for missing "Clear selection" on single-select tables

Wondering what happened to the "Clear selection" button on your single-select tables? Me too!

While the Retool team works to restore the ability to deselect a row in a single-select-mode table (hint, hint) you can reasonably replicate this inexplicably dropped functionality:

Create a JS query with table.selectRow(null); here I'm naming the query "tableDeselectRow."

Configure your table's toolbar custom button like so:

Show custom button fx: {{ !! }}
Button text: Clear selection
Button query: tableDeselectRow

Screen Shot 2022-04-18 at 4.08.23 PM

This is as close as you can get to the built-in functionality that we've lost – main difference is that it appears on the right side of the table toolbar instead of left (well, that and the effort involved for your tables that rely on this).

This workaround does use up the single instance of your table's custom button, so if you're already using your table's custom button, create the same JS query but trigger it from a button or link (or, move your original custom button function to a button or link to free up the table's toolbar custom button, whatever your preference).

Hi @Schteevynn! Thank you so much for sharing this. We flagged this to eng so we can bring this behavior back, actually :blush: It should make it on a deploy very soon!


@victoria YAY! I had to patch eight tables this week because of this; it broke linked forms, and hobbled some Wizard step navigation, too.

I've been having to use the workaround on any new tables created since the toggle weirdly disappeared from the inspector over a month ago. Then this week had to scramble on older tables when the grandfathered-in original buttons also went missing, apparently over the weekend.

Thank you – I look forward to this being native functionality once again!

1 Like

@victoria this appears to be fixed, what a relief. The button is back and the toggle is back. Thank you. Since the original functionality is restored and the workaround isn't needed anymore, go ahead and delete this whole thread, if that makes sense to do?

My parting thought on the topic is that I agree with the other community member who posted preference for the older "Clear selection" to the newer, not-as-clear "Clear."

@Schteevynn Ooh that's absolutely valid. I notified the eng team for consideration! Thank you for taking the time to share your thoughts here :pray: