Self referencing the component in the event handler

Hey, everyone.

I did some research and couldn't find an answer for this. Is there a way to reference the component I'm calling a event handler from while using the js script?

I understand I can't use "self", but the what I'm trying to achieve would be to replace the "textArea2_form_guia.label" with "self.label".

Captura de Tela 2024-08-07 às 09.18.47

Thanks!

Hey!

You should be able to use the component's id property to reference this by default in the component setup. You can see it in use in Form data key:

image

If you change the component's name it should update in any place you've referenced the component:

image

Above, I only renamed the component, and Retool updated the reference and the id.