Closed johnaweiss closed 5 months ago
Solved. There was an excess space in my split. This works:
{
{%- for item in answers -%}
{%- assign oLabels = item.sublabels | Split: ',' -%}
{%- for label in oLabels -%}
{{label}}
{%- endfor -%}
{%- endfor -%}
}
How can i treat string like an object, to iterate on nodes? If i do a
for
, then it iterates on every character. If i split on comma, it doesn't split at all.I'm using this tool to evaluate my template. https://pramodvalavala-msft.github.io/liquid-playground/
My template:
My data:
Liquid output: