Element expirationdate is undefined in a CFML stru...
# cfml-general
g
Element expirationdate is undefined in a CFML structure referenced as part of an expression.
t
I think your problem is here:
null="#!date(data['expirationdate'])#"
If
expirationdate
does not exist in
data
, you'll get that error, because you'll end up trying to run
!date(undefined)
g
as the api is sending the undefined for few other fields, so how do i tacke this issue
t
Check for existence first
null="#!data.keyExists('expirationdate') || !IsDate(data['expirationdate'])#"
ie, null if the key does not exist, or if the value in the key is not a date.
g
that works
Thanks