How do I use the Page-level URL Search or Hash Parameters

Goal:

Steps / Details:

  • We were able to do this in another app using the legacy single-page app. We want to replicate the same behavior in a multi-page app.
  • The old settings were like this:
  • Now the same settings at page level look to be different and I don't know how to use it.
  • When I try to access {{ url.hashParams.search }} it's always just an empty string. Not sure what I'm missing here.
  • Not sure the difference between search and hash parameters either, but so long as this behavior is replicated, happy to use either one. :woman_shrugging:

Could anyone help me replicate the same behavior in a multi-page app?

The behavior of multi-page apps is a little different—you use the page-level url/search params to configure the URL, but you would use {{ url.hashParams }} and {{ url.queryParams }} to read in the URL. These will only be populated if you navigate to the page with url params/hash params!

If you navigate to yourappLink.com/app/appName/yourPage#search=hello, is {{ url.hashParams }} still null?

@Isabella_Borkovic,
I have been playing around with this and there seems to be a bug in the params. When you add search or hash params to one page and then run a query to return {{url.hashParams}} or {{ url.searchParams}}, it runs just fine. But as soon as you go to another page and add hash or search params to THAT page, when you return back to the original page, and run the same queries, the return values are empty. (but the parameters are still showing in the UI)

Hi Isabella -

I just tested again today, it didn't have the same behavior as before. So I assume this is being worked on or something changed when I published.

Thanks for the help tho!

Ah I see, I think if you set the URL search param in the page settings then it will populate the url with that value.

try deleting that URL search param and seeing if the issue still persists!

1 Like