Olá! Nós temos uma Comunidade em Português!

Printing Values from HubDB "select" column

resolver
Sachkundiger

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

Responder
0 Avaliação positiva
1 Solução aceita

Soluções aceitas
Highlighted
Mentor

@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?

- Jonathan Sumner
2 Respostas 2
Highlighted
Mentor

@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?

- Jonathan Sumner
Sachkundiger

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

Responder
0 Avaliação positiva