Condition in Date Time Function | Community
Skip to main content
Level 1
February 24, 2026
Question

Condition in Date Time Function

  • February 24, 2026
  • 2 replies
  • 23 views

Hello,

I am using a date time function in a fragment where i have to check if the value in attribute exists or not.

{% let SO = Bonus1.swappedTimestamp %}

                                        {%#if isNotEmpty(SO) %}

By using this condition, I am getting this following error:
 

 

2 replies

Level 4
February 24, 2026

Hi ​@ShivikaBa I believe isNotEmpty() only supports string data types in AJO. Since swapped timestamp is a date-time type, it causes a type mismatch error. Instead, use isNotNull() which works for all data types including timestamp:

{% let SO = Bonus1.swappedTimestamp %}{%#if isNotNull(SO) %}    {{SO | formatDate("dd/MM/yyyy")}}{%/if%}
https://experienceleague.adobe.com/en/docs/journeys/using/building-advanced-conditions-journeys/main-functions-journey/string/functionisnotempty

Thanks

AJODev

Pulkit_Jain_
Adobe Employee
Adobe Employee
February 25, 2026

isNotEmpty(SO) only works on a list of strings and seems the variable SO is a date-time field, not a list.

Try:

{% if SO.isNotNull() %}
....
{% /if %}

or

{% if Bonus1.swappedTimestamp.isNotNull() %}