Redirect parent window from Retool

I need to redirect the parent window based on a custom html form submission from within Retool. Retool is hosted in an iframe on my webpage.

Trying to use = ""; causes the following error: Failed to set the 'href' property on 'Location': The current window does not have permission to navigate the target frame to ''.".

This is a pretty critical use case here and would love some ideas.

1 Like

Hi @DakotaB! We have a utils.openUrl() function that lets you open a link either in a new tab or the same retool tab. If this url change is from a custom html component, you could trigger a Run JS Code type query from the customer component

Hey @alex-w. Thanks for the response, I do know about the utility. The issue is that when Retool is iframed, it just changes the window location of the iframe rather than the parent window. Normally I could use something like = "";
to redirect the parent window but that does not appear to work with retool.

Hey @alex-w I am trying to use utils.openUrl() to redirect to my iOS app but I am getting the same as @DakotaB then when I try from a desktop, then from my mobile phone, I get that the URL I am redirecting to is un-safe. Is there a workaround? I know that using the built-in re-direct on a button click says that Retool only accepts certain protocols… is there a way around this?