Url object undefined

Hello!

what might be the reason I cannot read url, not to mention my hash ? its correctly set to the url - my hash param. Any ideas:)?

I’m setting the param like that, and its vicible in the url (not in location.href)

const value = (teamCountrySelect.value || ).map(encodeURIComponent).join(',');
utils.setUrlParameters(null, [{ key: "countries", value: value }]);

Hey @Anna123NW,

I believe this might be a bug. When we try to set the value using the following code:
Because its set the value in hashParameters.

utils.setUrlParameters(null, [{ key: "countries", value: value }]);

But it does not work when we attempt to read the value using:

{{ url.hashParams.countries }}

However, when we set the same value through the URL option in the event handler, it works correctly and we are able to retrieve it from the URL as expected.


It is working fine for get from the url

It seems that Retool currently does not expose URL values properly when they are set using utils.setUrlParameters. You can find a related discussion about this limitation in the Retool community forum here:

1 Like

@WidleStudioLLP thanks! i’m setting the parameters in the first app, passing them as hash when going to second app (not page), and then the goal is to have then still in the url in the same session when user returns to the first app.

how to have them still in the url?

Hey @Anna123NW

To set parameters for the second app, you can use the “Go to app” action inside the event handler and pass the required values through hash parameters.

In the second app, you can then retrieve these values using:
{{ urlparams.hash.countries }}


1 Like

That part I got :slight_smile: is there any option to persist those hash parameters on returning again to the first app with browser arrow click return?

@Anna123NW

No, I don’t think there’s anything else. You need to pass the same URL hash parameters back to the first app that you originally passed to the second app when returning.

1 Like