Ability to programmatically set the hidden field of any component

Every component has setValue() method. A setHidden() attribute will help dynamically alter the UI, show notifications, banner and a lot of use cases.

Hi @goku! We actually plan to launch setHidden as soon as this week. Stay tuned!

1 Like


longest week ever? :smile: just kidding, but is this still planned?

1 Like

Hi @G1ofG3 setHidden has launched :slightly_smiling_face: It should be available for many components:

In doing some testing, it looks like there may be some exceptions, such as the table. In this case, my recommendation would be to use a container around the table, which can be used with setHidden.

Which component are you looking to set to hidden?

I see, I've tried this yesterday at the alert component, there its not available for example. And the question was if its possible to add this to all components.

So is there a list where its available and where its not ?

Hi there!

I looked into this internally. It looks like we added .setHidden for all of our newer components, but some of the components that have not been recently updated still don't have .setHidden. This at least includes: JSON Editor, JSON Explorer, Button Group, Alert, Cascader, Checkbox Tree, and Rich Text Editor. You can check the components page under Methods to confirm whether a component is compatible, or you can see if the method comes up in auto-complete in the JS query editor. We have a feature request on file to go back and add it to all components. I'll post here when that request is completed.

In the meantime, here's another workaround if you don't want to use containers!

1 Like

Hi @Tess
I have tried unhiding the keyValue component in the retool using the script like keyValue1.setHidden(false). But its not working. The confusion is we have two different keyValue components in the updated retool version. The previous Keyvalue component is not working with the setHidden function. Can you please help me in here

Hi @Jyothi,

The legacy key value component doesn't have support for .setHidden :disappointed: but the new key value component does! Any chance you can swap out all of your key values to the new key value component?

Otherwise, I'd recommend putting the legacy key value component into a container with no padding, margins, or header