Query params combined with a custom url

Hello!

I'm exploring using retool to build an application with a couple of pages. To make this work, I am navigating between apps passing a query param, which is used to set some defaults when each app loads.

All was working well, until I added a custom url to the main page. Now, when navigating to this app, the parameter appears briefly in the URL before vanishing, almost like a redirect. It doesn't take effect on the page.

In the editor, everything works fine as it doesn't use the custom url, but when viewing the app as a user, it breaks.

Any ideas what I might be doing wrong, or do query params and custom urls not mix?

I should add, I have tried with both normal query params and hash params.

Page settings for the main app (with a custom url):
image

Call to return to the app with a query param:
image

Firstly, here are some steps to make sure your configuration is correct.

  • Review the application's settings in the docker.env and docker-compose files and confirm that they have been correctly updated to reflect the new custom domain.
  • Double-check whether the field in your docker.env file has been updated with the new custom domain.

If these are fine, try removing the URL params that you configured, then refresh the app and add the URL params again. Leverage git to commit your changes to save the work you have now, in case you need to move back after the changes suggested here.

Thank you for your reply.
Apologies if this is a stupid question, but is the docker.env accessible if using the SAAS retool? I am not self-hosting.

What appears to happen is that the "Go to app" routes to the url without the custom url (but with the correct query parameters). This immediately re-routes to the custom url, but the hash parameters are lost in the process.

Hey @David2! Stepping in here.

Definitely not a stupid question. If you're using the Cloud Retool (instead of the Self-Hosted Retool), you won't have a docker.env file as there won't be any Docker containers for you to manage.

To clarify your current setup, you want to click and refresh the current app, just with the organisationId filled in the query params?

Is there a reason you're using query params instead of just referencing the org_id_input.value directly?
Screen Recording 2023-12-18 at 7.57.02 PM.mov

Thanks Victoria.

No, I am navigating between to apps, but I want to carry data over between the two (namely, the selected organisation Id). To do this, I wanted to navigate to the second app, with the organisation Id in the query string.

As a workaround, I have started using openUrl instead of openApp. This allows me to navigate directly to the custom page url, so there are no redirections. This works fine.

The issue occurs using openApp to open an app with a custom url. I think what is happening here is that the app initially opens with a guid in the url, with the query string present. The address then appears to be re-written to the custom url, but without the query string.

Using openUrl (which works):
image

Upsing openApp:
image
Here, the hash parameter does not make it.

Another note: when navigating within edit mode, the issue doesn't occur. My assumption is that this is because the editor always uses guid app ids in the url, and not the custom url.

2 Likes

I just ran into the same issue. With URL works fine, with app its just not working at all. Thank you for the workaround

1 Like