Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.

How to write an expression to use in email to check a field date equals today

Avatar

Level 1

Hi there,

 

May I ask how can I write an expression to check a condition in my email - to check if product > field date value = today? I tried the below and didn't seem to work. My product date field format is "2024-12-19".

 

{%#if productDate = currentTimeInMillis() %}

 

Thanks,

Amanda

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Level 1

May need to try something like this  {%#if toDateTimeOnly(currentTimeInMillis()) == toDateTimeOnly(productDate) %}

Avatar

Employee

You can validate it on the following lines 

{%let a = now %} 
{%let b = toDateTimeOnly("2024-12-19T09:57:27.980Z") %} 
{%let c = dateDiff(b,a) %} 

{%#if c =0 %} // If the difference is zero, product field date is today
render_1
{%else%} 
default_render 
{%/if%}