Select - On Select - Open Another Retool Page

I'm trying to build a "quick launch" with a Select where On Select opens a new app with provided url params. I'm currently using On Select with a JS Code query containing a call to utils.OpenUrl. The one challenge with the JS Code query I'm running in to is getting the current url. Bare with me, I'm by no means a js expert but a little googling directed me towards window.location.href. It's not returning what I was expecting. I can hard code the production url in to OpenUrl but it doesn't stay in the editor when editing; not really that big of deal. I think adding a utility to like utils.OpenRetoolPage or adding the same feature set that button on click currently has would be very helpful.

Hi @matth. Maybe this will help you, https://docs.retool.com/docs/create-a-multi-page-app. It explains opening a Retool app from another. I am not sure about sending the URL params. ~Maybe global storage…?

or another way of Opening another retool page via js utils. It works when I hard code the url like
utils.openUrl("https://mydomain.retool.com/apps/myfolder/myapp?id=<myid>, false)
I was thinking something like
utils.openRetoolApp(app="myapp",urlparams={id:myid},inNewPage=false)

I understood that, I’d hope it could assist with the pieces needed. I just found this: https://docs.retool.com/docs/create-a-multi-page-app#section-linking-and-passing-data-with-text-components

That could be useful, yes. In my book, the more programmatically done the better (in most cases)!

Yeah right now directing straight to the url does work, but if you rename the app it will get broken :confused:

Has there been any improvement on linking between apps? We have several <a> tags implemented inside Text components, and as apps get reorganized the links end up pointing to non-existent URLs. The Button component w/ "Open another Retool app" would be nice here, but we don't need something as heavy as a button.

We actually just started rolling out a new component "link" that has styling similar to an <a> tag, but behaves like a button. I think that this, in combination with the "Open another Retool app" event handler will be a perfect fit for what you are looking for!


1 Like