why isn't my email template pulling the expense re...
# ask-stanley-ai
n
why isn't my email template pulling the expense report expense line values in the email: <#if transaction.expense?has_content> <#if transaction.expense?size > 99> <#assign maxIndex = 99> #else <#assign maxIndex = transaction.expense?size - 1> </#if> <table style="width: 100%; border: 1px solid black; border-collapse: collapse;"> <thead> <tr> <th style="border: 1px solid black;">Category</th> <th style="border: 1px solid black;">Quantity</th> <th style="border: 1px solid black;">Description</th> <th style="border: 1px solid black;">Amount</th> <th style="border: 1px solid black;">Class</th> <th style="border: 1px solid black;">Exception</th> </tr> </thead> <tbody> <#list transaction.expense[0..maxIndex] as item> <tr> <td style="border: 1px solid black;">${item.category}</td> <td style="border: 1px solid black;">${item.quantity}</td> <td style="border: 1px solid black;">${item.description}</td> <td style="border: 1px solid black;">${item.amount}</td> <td style="border: 1px solid black;">${item.class}</td> <td style="border: 1px solid black;">${item.custcol_exception_description}</td> </tr> </#list> </tbody> </table> #else <p>No expense lines were found on this record.</p> </#if>
c
AI generated answer (using internal Slack threads):
The issue with the email template not pulling the expense report expense line values could be due to several reasons: 1. The
transaction.expense
object might not have any content. The
?has_content
built-in checks if the sequence (in this case
transaction.expense
) is not null and not empty. If the sequence is null or empty, it will not enter the
if
block and hence, no values will be pulled. 2. The fields
item.category
,
item.quantity
,
item.description
,
item.amount
,
item.class
,
item.custcol_exception_description
might not exist or might not have any values in the
transaction.expense
object. If these fields do not exist or do not have any values, they will not be displayed in the email. 3. There might be an issue with the FreeMarker template engine processing the template. FreeMarker is a Java library to generate text output based on templates and changing data. If there is an issue with the FreeMarker processing, it might not be able to correctly process the template and hence, not pull the values. To debug this issue, you can try the following: - Check if the
transaction.expense
object has any content. You can do this by logging the
transaction.expense
object and checking its content. - Check if the fields
item.category
,
item.quantity
,
item.description
,
item.amount
,
item.class
,
item.custcol_exception_description
exist and have values in the
transaction.expense
object. You can do this by logging these fields and checking their values. - Check if there are any errors in the FreeMarker template processing. You can do this by checking the logs for any errors related to FreeMarker. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840610087
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839962
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836934865
Please provide your feedback on this answer.