Display QueryString / $_GET on client side

Hello Community,
On the client side how do you simply display a QueryString variable, i.e. obtain the variables from the URL? ex: mydomain.com?var=value
Am I missing something simple?
Again NOT trying to pass something from client to server SC, just want to catch the var and have it as a binding on the client side.
Basically an equivalent to <?= $_GET["var"];?> but s a Wappler binding.
Any idea?
Thanks!

You want to get the value of the URL parameter var and use it on the page?

1 Like

Not sure if this answers it… I’d like to get the URL parameters aka queryString
The variables at the end of the URL ex: http://mydomain.com/?var=value

It does answer it. Use query.var to get the value.

if you click on App in app connect. And then click on define query params. Add your variable there. Then it will show up in the picker after that. and all the pages that have the same app id those same variables will show up in the picker.

@Teodor @mebeingken @baub thanks for the further explanation, this works well and I’m able to pick up my URL queryString.

On another note, I’m noticing what @baub is saying: " all the pages that have the same app id"

I have call each of the pages on my website/domain by a distinct name, as I thought they should all be different, almost like the filename. Is that a mistake, should all the pages have the same app id, ex: “myproject”?

It’s not wrong to have different IDs.
Also the query parameters can be directly called like {{query.var_name}} without defining them first under app > query parameters (what’s explained in the docs above). It’s only required if you want to see the query parameters in the picker.

1 Like