最近搜索


没有最近搜索

Multi-Select Liquid Markup Case Statement

已回答


已于 2022年4月12日 发布

I am attempting to determine what values are contained in a multi select and based on that, send certain content in an email through Dynamic Content.  What is the best way to traverse the values of the Multi Select?

{% case ticket.ticket_field_80818947 %}
{% when 'VALUE 1' %}
<p>Content for VALUE 1</p>
 {% when 'VALUE 2' %}
<p>Content for VALUE 2</p>
 {% when VALUE 3' %}
....
 {% endcase %}            


0

1

1 条评论

image avatar

Christopher Kennedy

Zendesk Developer Advocacy

Hi Ronald,
 
The multi-select value will be a string of the selected tag values for the field separated by a space.  The simplest approach to evaluating the selected values involves using an if statement with the contains operator.  So from your example:
 
{% if ticket.ticket_field_80818947 contains 'VALUE_1' %}
<p>Content for VALUE_1</p>
{% endif %}
{% if ticket.ticket_field_80818947 contains 'VALUE_2' %}
<p>Content for VALUE_2</p>
{% endif %}
 
If the selected value is VALUE_1 or VALUE_2, the content for that value is displayed.  If both are selected, then the content for both values are displayed.
 
Best,

0


请先登录再写评论。

找不到所需的内容?

新建帖子