Hi,
I have a problem with printing from a multi-selector. I know this seems to be a common problem and I have tried multiple solutions but all produce the same result.
I have set up in HubDB a column called Location Selector. All I want to do is print the values(Name) of each selection.
When I try…
<ul class=“list-con”>
<li class=“icon1”>Location: {{ dynamic_page_hubdb_row.location_selector }}</li>
<li class=“icon2”>Employment: {{ dynamic_page_hubdb_row.employment }}</li>
</ul>
I get…
[{id=1, name=‘Cheadle’, order=0}, {id=2, name=‘Manchester’, order=1}]
As per other posts, I just want to post the name. If I use {{ dynamic_page_hubdb_row.location_selector.name }} I get nothing. It’s blank.
I even tried the below, which works, but prints out the full value as shown above.
{% set table = hubdb_table_rows(tableID, queryparam) %}
{% for row in table %}
<ul class=“list-con”>
<li class=“icon1”>Location: {{ row[“location_selector”] }}</li>
<li class=“icon2”>Employment: {{ dynamic_page_hubdb_row.employment }}</li>
</ul>
{% endfor %}
However, if I use row[“location_selector”] .name I get the following warning. I don’t get how it cannot resolve a property when it clearly shows name as a property.
Warning:15:0 Cannot resolve property ‘name’ in ‘[{id=1, name=‘Cheadle’, order=0}, {id=2, name=‘Manchester’, order=1}]’
what am I missing?