Unable to pass input to a module from an app

I am not able to figure out how to pass input to a module. I have an app which has a listbox control and a module on which I have defined an input property (let's call it input1). What I want to do is pass the selected value of the listbox control as the value for input1.

What exactly I need to do in the change event of my listbox control so that the input1 property of the module gets populated.

My understanding is that I would then create another query in my module which will have a syntax like select * from {{input1.value}} and when this query finishes successfully, I should get the value of the selected item from the app's listbox control.

Spent a good amount of time trying to figure this out so any insights into this would be highly appreciated.

FWIW, I referenced following threads but unfortunately nothing has worked for me so far:

Hi @gmantri, Is {{input1.value}} a table name on a SQL resource? If so then you would need to disable prepared statements on your resource in order to dynamically pass the table name to the query. By default, all of our SQL queries are converted to prepared statements to prevent SQL injection, meaning that table/database names and SQL functions aren't able to be defined using a string created dynamically.

You can disable this setting in the resource setup, but keep in mind the potential of submitting dangerous SQL through any of the variables referenced in a query. Disabling prepared statements can also break other existing queries. If that's something you'd like to explore, we recommend setting up another copy of a resource with that setting enabled to help limit the surface area that you have to keep in mind SQL injection for.

If you don't want to disable prepared statements, then you would need to create multiple queries for each table and create logic in your module to trigger the corresponding query. Hope that helps!