-
Goal: Trigger a page reload when directing a user to one of our Apps from another app (or even refreshing the current app with a page reload)
-
Steps: Using the Go to Url option on a button click, to direct the user to a different app, I have selected the option "Disable client-side routing". I have also tried using the "Go to app" action but that also uses client-side routing. I even tried using a script for the action and triggering
utils.openUrl(url, {newTab: false, forceReload: true})
. I've tried settingwindow.location.href
. I've triedwindow.location.replace()
. I even tried replacing the button with standard html to use<a>
tags to redirect to the app. -
Details: All of the methods I've listed above trigger a client-side routing action to the destination app, when I need to force a page reload to happen. In one case, the button linking to our account app can also be displayed on our account app (passing different values for the hash params), and clicking it doesn't even update the params in the URL, so even though it's enforcing the client-side routing, this isn't even working as expected.
-
Screenshots: Sharing a screenshot of the button action. I have a screen recording of the issue in action, but I'd prefer not to share it publicly due to some private information within the content. Can share privately with Retool staff, and I've also shared it in a support email but I was asked to shared this issue here instead.
Hi @cosmick,
Thanks for reaching out with all of these details. I was able to see your screen recording that was sent via email as well.
I see that we are tracking this bug in our backlog I've added your +1 to the bug report. I don't see any known workarounds yet, but I will do a bit more testing & follow up with you here
Does it help to update a dummy url param in addition to the hash param on go to url? I know that is very hacky
Something like, ?accountId={{orgData.value?.contactAccountId}}#accountId={{orgData.value?.contactAccountId}}&tab=account
Thanks for the reply, @Tess!
While the hacky workaround will work for the initial click on the button, any subsequent clicks still experience the same issue. It does not force a page reload because the URL (minus one hash param) is the same. I would have hoped the change in hash param would have been enough to trigger the page reload.
I guess I can try to get even more hacky with it, and have the button generate a random value for the URL param on each page load. That might be enough to force a page refresh, although it will make our page URLs a bit "ugly", containing unnecessary params.
I'll report back on the success of the random values
Okay the random value seems to work reliably: ?temp={{Math.floor(1000 + Math.random() * 9000)}}#accountId={{orgData.value?.contactAccountId}}&tab=account
I would definitely prefer not to have random URL params in the URL but happy to have the button working as expected. Would definitely appreciate a heads up if/when the bug is fixed
Thanks again for the help, @Tess
Yes, I will let you know if a fix ships!