Question
How do I display multi-select field values as a bulleted list using triggers?
Answer
Use the Liquid split filter to divide this comma-separated list into an array, then display the items in that array in a bulleted list.
You can use the following Liquid statement in your trigger email body. Replace 12345678 with your desired field ID:
{% assign options = {{ticket.ticket_field_option_title_12345678}} | split: ", " %}
<ul>
{% for member in options %}
<li>{{ member }}</li>
{% endfor %}
</ul>
The code above sets a variable, options, to be the value of the multi-select ticket field. It then splits this variable at each comma, providing an array of options instead of just a single-line list.
In triggers, the line break is rendered in the email output and creates whitespace. When you implement this, place all the code on a single line.
{% assign options = {{ticket.ticket_field_option_title_1234578}} | split: ", " %}<ul>{% for member in options %}<li>{{ member }}</li>{% endfor %}</ul>
For more information, see Understanding Liquid markup and MorgWard Support.
Comments
0 comments
Please sign in to leave a comment.