Open bryllyg opened 3 years ago
Hey @bryllyg,
I do not have a field that contains multiple values separated by a comma, so I went ahead and plucked values out of a column to re create the scenario:
{{#each (unique (pluck DepartmentItems "Group"))}}{{.}},{{/each}}
Where "(pluck DepartmentItems "Group")" is the array of values that contain duplicates. For your script, I would change
{{#with {split fieldname ',') as |tag|}}
to
{{#with (split fieldname ',') as |tag|}}
and
{{#each unique tag}}
to
{{#each (unique tag)}}{{.}},{{/each}}
Hope this helps. Let me know if it does, or if I need to do something differently. I didn't know about the ability of "as |item|" until now, but maybe it is just your system that allows it?
Thanks! I'll give it a go.
Syntax and functionality question - The list I am querying has a field with multiple comma delimited values. I am trying to:
I can do one or the other, split the entry OR get unique, but I can't figure out a way to do both. Is it possible using the provided helpers?
I've tried variations using {{#each items as |item|}} {{#with {split fieldname ',') as |tag|}} {{#each unique tag}}
Any suggestions? Thanks!