Can you use dmx.app.set to define a parameter in Query Manager?

Hey,

Usually when I’m setting a value from a JS function into my app i simply use dmx.app.set('var_name', value)

Then in app connect i usually use dmx-bind:value="var_name" to bind that value to an actual app connect variable to easily use it queries, flows etc.

I’m trying to use Query Manager to better manage the growing number of variables used on a particular page, but you can’t bind a value like you can with a AC Variable component. You need to use something like query1.set('var_name', value)

Now, i can’t quite get this to work from a JS function using dmx.app.set. What would be the right way to go about this?

I’ve tried running a flow in app connect to set the values based on the variable names set in the JS function, but that hasn’t seemed to work. Any ideas?

1 Like

The query manager is for getting variables from the querystring, not for managing local variables.

At this moment the easiest way to manage variables is using the AC Variable component. This is not ideal when you have many variables since it creates a lot of dom elements.

The alternative is using the global scope. You can set it in javascript using dmx.global.set('var_name', value) and we have a flow action Set Global which also can set variables there. The problem is that you don’t have the variables in the data picker. We are working on a feature to manage these variables from within Wappler so that they become available in the data picker and you don’t have to hand-code the variables.

Ok thanks for explaining that @patrick. That’s good to know.

One thing I don’t quite get though is what you mean by querystrings? Are you talking about database queries?

The query string is specified by the values following the question mark (?) in an URL, like this:

https://mywebsite.com?name=John&surname=Doe

name and surname are querystrings

Thanks Teo. I think I get it now