Email script - isEmpty() not working
I'm trying to use an #if statement in Velocity to check whether a field is empty. As per Sanford's excellent article here, Marketo imports everything into Velocity as strings, so he suggests using $var.isEmpty() instead of switching between different methods based on data type.
But when I use this statement (and this statement only) in a script:
${Tour_Evaluation__cList.get(0).Testimonial__c}.isEmpty()
The output I get is either the full testimonial, with the string isEmpty() after it (eg. "I had a great time.isEmpty()") or simply the line "${Tour_Evaluation__cList.get(0).Testimonial__c}.isEmpty()" if the variable truly is empty.
Shouldn't this evaluate to True or False, and display this back to me?
As a second check, I tried (it's a text field):
#if( ${Tour_Evaluation__cList.get(0).Testimonial__c} == "" )
<b>True</b>
#else
<b>False</b>
#end
This gives me False in all circumstances.
Any ideas?