function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bob DeRosierBob DeRosier 

datetime field in IF statement in HTML email template

I have an HTML email template that keys off a registration record that I am attempting have display a datetime field under certain conditions.   If I display the field by itself
{!Event__c.Follow_up_Date__c}

  it displays as I expect. Similarly, this date/time field
{!DATEVALUE(Registration__c.Start__c)}
displays as I expect.  However,
{!DATEVALUE(Event__c.Follow_up_Date__c)}

 does not display anything event though the field is populated.   They are both date/time fields, so the non-uniform behavior puzzles me.

However If I put it inside an IF statement, it displays nothing. Both of the following produce blank output.
{!IF((1 = 1),DATEVALUE(Event__c.Follow_up_Date__c),'False')} 
{!IF((1 = 1),Event__c.Follow_up_Date__c,'False')}
Note that in these 2 lines, one has DATEVALUE and the other does not.

From my experimentation, this seems to be a problem displaying a date/time field within an IF statement.