I am creating an email template that uses fields f...
# general
p
I am creating an email template that uses fields from a sublist. I would like a header to only print if a field on any of the sublist items has a value. I tried the following but the header does not print.
<#if transaction.recmachcustrecord326?has_content>
If I build the list before the #if statement it prints and change the #if statement to:
Copy code
<#list transaction.recmachcustrecord_myfiles as files>
<#if files.custrecord326?has_content> 
My Header Text
</#if></#list>
the header repeats for every line item in the sublist. Any ideas on how I can achieve my goal?
m
build the table? <tr> <td>
j
I always found has_content to be a bit unreliable - I've had more luck with
Copy code
<#if files.custrecord326?length gt 0>
Once you have that bit figured out (you should have My Header Text only the number of times the field is filled in), then you need to change your structure a bit if you only want My Header Text once (sorry if this is not what you intended)
Copy code
<#assign printflag = 0>
<#list transaction.recmachcustrecord_myfiles as files>
  <#if files.custrecord326?length gt 0>
    <#assign printflag = 1>
  </#if>
</#list>
<#if printflag == 1>My Header Text</#if>