Query parameters visible in URL but not on page

Klaasie
Member

I have a strange issue with using query parameters as text on a website page.
Sometimes they do not work / show on the page altough they are visible in the URL.

 

Here are some code examples.

On a first page I create a link with the parameters. The URL looks like:

https://www.website.com/nl/webinars?webinar_info=Title of Webinar - Monday 1 July 2020&webinar_id=1234567

On the next page I want to use that information on the page. The code snippets for that are:

 

{% set webinars = hubdb_table_rows(2625480) %}
{% set current_webinar = webinars|selectattr('hs_id','equalto', Query.webinar_id) %}

 

{% if current_webinar | length > 0 %}  

{% for webinar_detail in current_webinar %}   

{{ webinar_detail.video_title }}   

{{ webinar_detail.date | datetimeformat('%A %e %B %Y') | capitalize }} # show the date

 

When I do a check on current_webinar, then current_webinar is empty [].
The strange thing is... It worked before and on another page we use the exact same code and there it works. Does somebody know how or why this can happen?

0 Upvotes
3 Replies 3
stefen
Key Advisor | Partner

@Klaasie it might be due to the uppercare "Query". I've had issues with a similar issue in the past. Also, you should use the official query variable which is "request.query" or "request.query_dict".

Stefen Phelps, Community Champion, Kelp Web Developer
Klaasie
Member

Thanks for your reply Stefen. I have tried both "request.query" and "request.query_dict".
But it looks like the hs_id can't be matched with the webinar_id in the url

{% set webinars = hubdb_table_rows(2625480) %}
{% set current_webinar = webinars|selectattr('hs_id','equalto',request.query_dict.webinar_id) %}

 

When I copy the URL, then it looks like this, which looks okay

https://www.website.com/nl/webinar?webinar_info=Title%20-%20Subtitle%20-%20Monday%2015%20June%202020&webinar_id=30575767146

 

0 Upvotes
Klaasie
Member

There seems to be some sort of delay in Hubspot. After changing the code and doing some browser refreshes with F5 and CTRL+F5 it still didn't work. And now a few minutes later it does work. Weird Smiley Frustrated

0 Upvotes