Passing parameters when opening Another retool page via JS Query

Hi team! I’m trying to open another retool app via a JS Query in my original retool app. I’m using the utils.openUrl() function to open the second Retool app. The trouble starts when I try to pass along some variable/table-data along with url. I want to send data as an object (as in trying to send the selecedRow's data from a table) like the way Retool allows opening another app with urlparams when triggering a button. I want to be able to do this exact thing with utils.openUrl()
If not this even a workaround for opening another retool app with something like urlparams in a JS Query should do.

I looked into the documentation but I haven’t find anything, can you help out here?

Hi @mudassar! Welcome to the forum! :sunglasses:

Using utils.openUrl() with the url of another Retool app and component data should work here. Here’s an example of adding the url param ‘name’ when opening another Retool app.

If you are trying to pass an object into the URL, you will have to use JSON.stringify() in order to cast it to a string.

Would something like this work for you?


Hey @ben
Thanks for the quick response. The suggestions that you provided were helpful, I’m now able to make it work. Also, yeah I was missing this modification JSON.stringify(), this was needed when passing objects into the URL, so thanks again. Cheers!

1 Like