Urlparams vs hash

I am a bit confused on this issue.

Most of the time when you choose a value to store in a URL it puts a hash (#). Sometimes it puts a normal url param (? or &).

Take a look at this where I managed to somehow get it to do both!

Maybe just a bug? Or a side effect of browser caching?

Should I be trying to just use url params or just hashes?

Hey @bradlymathews!

Happy to help here! Typically if you are looking to pass params from one site to another you use URL params which show up after a ? and are separated by & symbols. When you are adding values to store in the URL with this interface though you are adding hash params, typically used when you are storing these values in the same sites URL. Were these URL params here added from navigating from another app in your instance?

Hello, I would like to add to that. We have an app that shows the details of some orders. In order to access the order you need to go to the URL /orders?order_id=1234.

In order to go to the next order we used to navigate to the new URL (with different order_id value) by opening the "same app". Unfortunately, retool, took too long to load all the components again, especially on mobile devices. So we decided to create a state order_id and redraw everything inside it when the state changes.

Now what is simply left is to sync the state with the url query parameter. As far as I can see we can only change the hash parameters. Which is not what we want as users.

Ideally the order/order_id=1234 should change to order/order_id=1235 if we changed the state internally.

If we use the mechanism provided (to change url params) it changes the url to order/order_id=1234#order_id=1235 which does not help.

Is that something we cannot address at all?

Hey @micbakos — I think in this case, you could rely solely on hash parameters, I think this stack overflow article does a good job of explaining the differences between when you would use one over the other. This is not a Retool-specific limitation but generally, hash parameters are preferred on single-page applications when you don't need to pass the parameter to the server and still want to re-run javascript to display different data without reloading the page into its starting state.

Thank you @Chris-Thompson for the response.