Passing url query parameters via embed link

I'm embedding a Retool app using an embed link and appending a page name to route users to the correct page and section in my multi-page app.

For example, this works as expected:

http://my-retool-embed-link.com/secondPage

However, I also want to pass query parameters to that page, like so:

http://my-retool-embed-link.com/secondPage?searchTerm=test

But inside the Retool app, the url.searchParams object remains empty

1 Like

Hi @van_d,

To add a search parameter value to the page, please ensure that the "Enable Persist URL Parameters" option is turned on.

You can do this by following these steps:

  1. Open the Pages panel.
  2. In the Inspector, enable the "Persist URL Parameters" option.

Refer to the screenshots below for guidance:


image

For additional reference, you can check out this forum post:
URL Parameter in Public URL – Retool Community

Please note that the forum example uses an older version of Retool, so the "Pages" and "Inspector" sections may look slightly different. Don’t let that cause any confusion.

Please let me know if you need any assistance with configuration.

4 Likes

Hey @WidleStudioLLP thanks for your reply. This looks promising, however I am not able to find the Persist URL Parameters toggle.

Hey @van_d,

Here's a small, tricky tip for enabling the "Persist URL Parameters" toggle:

Go to the Pages section β€” make sure you click on the "Pages" section itself, not on any individual page.

4 Likes

@WidleStudioLLP If i click in the section itself i get this

@van_d ,

Don't select any specific page β€” just go to the Pages section and click directly on the Pages heading itself.

4 Likes

@van_d

You can also see this option in the "Go to page" event handler.

4 Likes

@WidleStudioLLP I have marked a circle where I clicked.

The Pages heading is not clickable for me.

I'm not sure the event handler is useful for me, as I am embedding the app in my React app and want to be able to navigate a user to the correct page/sections with search params via the url

Hey @van_d,

Check out this Retool documentation β€” it’s really helpful for finding the "Persist URL Parameters" toggle:

4 Likes

@WidleStudioLLP I tried to follow the docs, but all of the actions result in an empty inspector (same a screenshots above)

@van_d ,

To access the "Persist URL Parameters" option, add ?inspect=true to the end of your app's URL to open the App Inspector.

image


4 Likes

@WidleStudioLLP unfortunately still no luck with the ?inspect=true param .
Upon further investigation of the docs, (The App Inspector | Retool Docs) it seems to suggest that the App Inspector is available on Retool cloud. I am running a self hosted version of Retool, is it possible this feature is not available for me or I am missing something somwhere?

@van_d,

Apologies for the confusion β€” I wasn’t aware that this applies to a Self-Hosted account, as I’m currently using Retool Cloud. But you might try using a "Go to page" event handler as a potential workaround.

4 Likes

@WidleStudioLLP thanks for confirming.

1 Like