How to clear input in a module from parent app?

Hi, I'm struggling to achieve the below.

I have a module that has a bunch of input fields like such:

In a parent app, I have a submit button, that once clicked and successfully ran a query to submit, I want to clear the input fields so that it resets to default state.

Also, I would like to have the reset operations performed from within the module so that it can be reused by other parent apps as well. So I have a JS query in the module that does the reset.

So the idea is that from parent app, this reset JS query is triggered and reset the input fields of this module. However, it doesn't work for me.

I've noticed the workaround mentioned in this post to trigger JS query from outside parent app, and that's what I did.

I have an INPUT that uses a default value that belongs to parent app's query.

I have a dummy SQL query as suggested to trigger the real JS query I want to run.

So when I triggered the parent app's query, it doesn't work (meaning the input fields in the module was not reset, in fact, the JS query inside the module to reset didn't even run). Here is the error log:

Looks like the problem is that the input default value couldn't use the parent app query's data. But it was suggested in this post.

So back to the original goal, as long as I can easily reset all the input field in the module, and reuse the reset query, that would be good for me.

Any pointer or support would be appreciated.

I changed the default value of the INPUT data to nothing, but changed value in parent app to use the parent app query's data, now I have successfully trigger the query in the Module, see the success log here.

However, it didn't have any effect on the module in the parent app. The input fields are NOT reset. The value I filled previously was still there.

Hey @mattsun!

You may still need to reference the module's input in the dummy query, e.g. select {{resetCreateFlag.value}} instead of select * from -.

Does that work?