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!