Remove all url parameters

Hi everyone,

I’m working on a Retool app and facing an issue with clearing all searchParams from the URL. I’m using a JavaScript query and attempting to reset the parameters, but it doesn’t seem to work as expected.

Here’s what I’ve tried so far:

1.Using an empty object:
utils.setUrlParameters([{}]);
This doesn’t clear the parameters as I expected.

2.Setting each parameter to null:
utils.setUrlParameters([{ key: ‘a’, value: null }]);
This works but isn’t feasible for me since I want to clear all parameters, and setting each key individually is not a scalable solution.

My Goal:
I need a method to clear all searchParams at once, essentially resetting the URL to its base path without any query parameters.

Does Retool provide a way to achieve this with utils.setUrlParameters, or is there an alternative approach I should consider?

Any guidance would be greatly appreciated!

Thanks in advance!

1 Like

Hi @Oleksandr_Dovgopol thanks for reaching out about this! It looks like this will require a feature request :disappointed: I'll request it internally & follow up here if it gets prioritized.

Technically, in the meantime, if you don't have default search params on the page, you could reload the app in the same tab

If the approach of setting them all to null works for now, you could use a JS query to map through all params and set them to null (Object.keys(url.searchParams).map...)

Circling back here for an update - we are still tracking requests for this (so please feel free to add +1s, but the request isn't currently being prioritized).

Hello, I'm adding my +1 here, I think it would be quite a convenient and useful feature

1 Like

Same thing, it would be also hepfull for me in order to exchange information between a global component and a page component