Hi all,
I can’t figure out why this bit doesn’t work.
I want to use a custom object property in a filterquery for hubdb_table_rows.
{% set function_group =<Object>["function_group"]%}
{% set filterquerytest = "limit=4&function_group=A" %}
{{ function_group }} #This results A
{% set filterquery = "limit=4&function_group=" ~ function_group %}
{{ filterquery }} # This results limit=4&function_group=A
{% for row in hubdb_table_rows(5321935, filterquery) %}
When I run this, it doesn’t work. When I change filterquery to filterquerytest it does. Can anybody assist with this?
Thanks in advance.
Hey, @RBouwman
Thanks for your question. Were you able to make any progress?
If not, here are a few suggestions:
Have you tried adding some additional debugging?
{% for row in hubdb_table_rows(5321935, filterquery) %}
{{ row }}
{% else %}
No rows found.
{% endfor %}
HubL should handle leading and trailing whitespace, but you can try adding trim as a test to make sure no trailing whitespace or special characters might be causing issues
{% set function_group =<Object>["function_group"] | trim %}
Best,
Jaycee
Hi @Jaycee_Lewis ,
Thanks for your reply.
Unfortunately, no solution yet.
The value I get from the custom propert also seems unaffected by filters. Example:
{% set function_group =<Object>["function_group"]%}
{{ funtion_group }} #Result: 'A B'
{{ funtion_group|urlencode }} #Result 'A B' where i would expect 'A%20B'
{% set function_groupencoded =<Object>["function_group"]|urlencode%}
{{ function_groupencoded }} #Result: 'A B' where i would expect 'A%20B'
{% set function_groupencoded = function_group|urlencode %}
{{ function_groupencoded }} #Result: 'A B' where i would expect 'A%20B'
It just seems the value of the property is fixed and cannot be used or changed.
Any other suggestions?
Thanks in advance!