Can I self-reference the component to get the name?


For example, I have a "Text Input"-component. I called this component for example "my_component". Is there some way to then get the default value to be "my_component"?

E.g. something like {{}}?

Best regards

Hi @axe! Thanks for reaching out. Can you try {{}}?

Hi @Tess ,
Thanks for the quick reply! That sounds exactly like what I need! :smiley:

However when trying it I get a type error:
The value has to be of type 'string | number' you provided a value of type 'undefined'"


Can I recast the type 'undefined' as string (as it can see that something is there) or is there any other solution?

Best regards

Hi @axe! Which version of Retool are you on? The version info can be found by clicking on the chat icon in the lower right corner of your screen. A menu should pop up which will show your Retool version number:

We are using 2.70.21, is this added in the latest releases?

I'll update and see if it solves it. Thanks :slight_smile: