Passing URL Variable Node JS

This is a simple thing, but cannot figure out how to do this in Wappler. Using Node JS. I have a working database query that gets a single flight by id ok. I also have a server connect on my page which will return all the flights to my page when I take the “WHERE” out of the query. When I filter by id, I cannot figure out how to pass the id to the URL ($_GET) variable. I have been doing this for years with Wappler and PHP, but cannot make it happen with node.

How do I pass the id to the url?

The database query works fine
I have a “id” variable in the app as well as the server connect.

Is there documentation on how to do this?

This is just a simple test page.

The value picked there is wrong. You are not using a query parameter here, but a value of id returned by the first record of your serverconnect1 server action. To get the query parameter named id, the value there should just be query.id

1 Like

Sorry for my newness to this. I tried manually changing it with no luck. in the server connect id field it does not show my app variable “id” to select. I also don’t know how the url should be formatted. (example?id=2525).

Is there a tutorial on how to do this in Node?

You are again picking the server connect value as a value instead of the URL param …
To be able to see the URL param there, you need to define it on the main page:

the only thing that the define query param option does is to make the query (URL) param available in the data picker. You can always just enter it manually in the code and it will still work.
Anyway - your code should look like:

dmx-param:id="query.id"

I already have query parameter in there. It Just doesn’t show up. Also what where do I put the url with a route? is it http://localhost:3000/admin/flights/usersonflight/id=1778

You need to define it on the main page, not on the content page!
Not sure i understand your question about the route and how is any route related here.

OK I got it. I added a query manager to the app and now it works. http://localhost:3000/admin/flights/usersonflight/?id=1579

Thank you

Mobile apps will not follow the routing as in the posted instructions. this is a workaround. (Example: /main/id/:id will not pass the variable. Have to use /?id=111 at the end to work)