@DrVeeVah that is possible using Freemarker directives such as
<#assign>
and
<#list>
, but it gets messy. I would advise creating a custom field and performing the logic in a script. You can save the result as a json string and parse it in Freemarker using