HubL filter if statement

Highlighted
Regular Contributor

Hi everyone,

 

I really hope someone can help me. I've recently setup a filter that displays my data if the status column is 'Available'. It works as expected, but I'm now trying to add a second rule - show the data if it is either 'Available' or 'Reserved', ignoring 'Sold' and 'Unavailable'.

 

I assumed it would require an If statement, but as yet I can't get it working. Any idea what I'm doing wrong?

 

hubdb-filter.jpg

Reply
0 Upvotes
2 Replies 2
Occasional Contributor

Try this below code and request.query_dict.topic  is get the data from URL

{% if request.query_dict.topic %}
{% set queryparam = queryparam ~ "&media_type="~request.query_dict.topic|urlencode %}
{% endif %}
{% set count = hubdb_table_rows(tableId, queryparam) %}

Reply
0 Upvotes
Regular Contributor

Hi @prasadcolumbus,

 

Pardon my ignorance, I might be missing something here, but isn't this used for when the user makes a selection, changing the filter on a live page?

 

I'm not giving the user access to the feature (yet), but instead it needs to be hard coded to only ever show if the status is either available or reserved. Is this possible?

Reply
0 Upvotes