Setting a value from a custom component to the app

I am trying to pass a simple test value "Hello world" from my custom component to a text input value.

My custom component is a Google map. I added the following code to trigger when a user clicks on a marker.
window.Retool.modelUpdate({ "testInput.value": "Hello Dolly" });

I'm not sure if it's necessary but I added in the custom component's model:
"testInput": {{ testInput.value }}

In the custom component's state, I can see the value:
chrome_KwYted92cA

However, in my text input component, nothing changes:
chrome_eozivPXeeL

How can I pass Hello Dolly into my test component?

@Shawn_Optipath You can use "testInput": "" in the custom component model. Then, you can retrieve the updated value from the custom component using customComponent1.model.testInput.

2 Likes

How is the input configured? I agree with @ZeroCodez, it seems like you may need to reference customComponent1.model.testInput. You could add it to the default value of the input component:

Or, have a query that is triggered from the custom component and sets the input component value:

1 Like

Thank you @ZeroCodez and @Tess. That worked.

1 Like