CMS Development

mgoswick
Contributor

Printing Values from HubDB "select" column

SOLVE

I'm sure there's a simple way to do this but I can't figure it out. I have a HubDB table with several entries that are categorized by a select list. Getting the filtering and such has not been a problem, but when I add {{ row["name_of_select_list"]}} inside of a <p></p>, rather than just printing the value like text and rich text columns do, it prints {id=#, name='Value from Select List'}. How do I get just the name value to print?
I tried:
{{ row["name_of_select_list"]}}.value,
{{ row["name_of_select_list"]}}.name, 
{{ row["name_of_select_list"].name}}, 
{{ name.row["name_of_select_list"]}},
etc.
and have not had any luck

0 Upvotes
1 Accepted solution
Jsum
Solution
Key Advisor

Printing Values from HubDB "select" column

SOLVE

@mgoswick,

 

in this tutorial They are using a select field for "type". When they call the value in the code  example they do so like this:

{{ row["type"].name }}

I see that you have already tried this but considering the syntax in the tutorial is correct (or at least assuming so) you may want to double check your code and try  it again. 

 

If it still doesn't work, would you share your code?

View solution in original post

2 Replies 2
Jsum
Solution
Key Advisor

Printing Values from HubDB "select" column

SOLVE

@mgoswick,

 

in this tutorial They are using a select field for "type". When they call the value in the code  example they do so like this:

{{ row["type"].name }}

I see that you have already tried this but considering the syntax in the tutorial is correct (or at least assuming so) you may want to double check your code and try  it again. 

 

If it still doesn't work, would you share your code?

mgoswick
Contributor

Printing Values from HubDB "select" column

SOLVE

Not sure why it didn't work before, but {{ row["type"].name}} worked as it should. Thanks.

0 Upvotes