in an email template, how do I get the value of a ...
# ask-stanley-ai
e
in an email template, how do I get the value of a field instead of the display text?
c
AI generated answer (using internal Slack threads):
In NetSuite email templates, to get the value of a field instead of the display text, you need to use the Freemarker syntax. The syntax is
${record.fieldId}
. For example, if you have a custom field with the id
custrecord_inbound_sales_rep
, you would use
${custrecord_inbound_sales_rep}
in your email template to display the value of this field. If you want to conditionally display part of an email based on whether a field has a value or not, you can use the Freemarker
if
directive. For example, if you have a dropdown field with the id
custbody8
, you can use the following syntax to conditionally display text based on whether
custbody8
has a value or not:
Copy code
<#if transaction.custbody8?has_content>
Has Content
<#else>
No Content
</#if>
If the above syntax doesn't work, you can try using brackets
()
or the
length
built-in to check if the field has a value:
Copy code
<#if (transaction.custbody8)?has_content>
Has Content
<#else>
No Content
</#if>
or
Copy code
<#if transaction.custbody8?length gt 0>
Has Content
<#else>
No Content
</#if>
****** 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.837023556
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831956625
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830698729
Please provide your feedback on this answer.