how to add in freemarkder an if the a field date i...
# ask-stanley-ai
n
how to add in freemarkder an if the a field date is before 30/04/2025 then display this pieve of code <#if record.custbody_psg_ei_qr_string ==""> <p> &nbsp; </p> #else <barcode id='qrcode' align='center' codetype="qrcode" showtext="true" height="80" width="80" value="${record.custbody_psg_ei_qr_string}"/> <!-- ${record.custbody8} --> </#if>
c
AI generated answer (using internal Slack threads):
To add a condition in Freemarker to check if a date field is before 30/04/2025 and then display a specific piece of code, you can use the following code:
Copy code
freemarker
<#if record.dateField?has_content && (record.dateField?date < "2025/04/30")>
    <p>&nbsp;</p>
<#else>
    <barcode id='qrcode' align='center' codetype="qrcode" showtext="true" height="80" width="80" value="${record.custbody_psg_ei_qr_string}"/>
    <!-- ${record.custbody8} -->
</#if>
In this code,
record.dateField
should be replaced with the actual field name of your date field. The
?has_content
checks if the field has a value, and the
?date
converts the field value to a date. The
<
operator is then used to compare the date field value with the date "2025/04/30". Please note that the date format used in the comparison should match the date format of your date field. ****** 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.837684
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819906175
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8102
Please provide your feedback on this answer.