Custom Objects: isEmpty() and Date Fields? | Community
Skip to main content
New Participant
April 24, 2024
Solved

Custom Objects: isEmpty() and Date Fields?

  • April 24, 2024
  • 1 reply
  • 1354 views

Apologies if I am missing something glaringly obvious, but is there any sort of issue with date fields and the isEmpty() conditional? Running into an issue where a visually empty field on my end is returning a value as if there was data in the field? It's a Date field type and there's only one record - but for the below loop it's returing the #else value even though the field in the UI is blank.

#foreach ( $item in $digitalBankingProfileList ) #if ( $item.luminDigitalBankingLastLoginDate.isEmpty() ) This works correctly #else Script is broken #end #end

Is it actually a NULL value that's making it see it as not actually empty?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Correct. Actual null is not empty. While Person fields can't be null in Velocity, CO fields can.

 

If you want to check for empty or null, use the null coalesce method:

 

 

#if( $display.alt($someField,"").isEmpty() )

 

 

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
April 24, 2024

Correct. Actual null is not empty. While Person fields can't be null in Velocity, CO fields can.

 

If you want to check for empty or null, use the null coalesce method:

 

 

#if( $display.alt($someField,"").isEmpty() )

 

 

New Participant
April 26, 2024

Thank you!!