Multichoice Fields
If a field is configured for multiple choice options and can have more than one value, then the items must be iterated as described in
Explicit processing of collections and content filteringFor example:
<jt:if test="${item.getChoiceList(1) != null}"><jt:forEach items="${item.getChoiceList(1)}" var="choice"> ${choice.name}</jt:forEach></jt:if>
Note the difference in syntax when referring to collection items versus complete collections:
• Collection items — item.getChoiceList(1)
• Complete collections — items.getChoiceList(1)
One thing to keep in mind when using the script above is that each choice value will be put on a new line. To put the choice values into a single cell separated by commas, use the following Groovy script with a Groovy tag to print the Category field's values to a cell
<cb:groovy template="false" silent="false">cats = fields.getByLabel(item,"Category"); result = []; cats.each({result.add(it.name)}); return result.join(",");</cb:groovy>
An
example template for exporting multiple choice fields is also available.