Validate JSON Hash Map Data

Adam
Level 2

I am using a JSON hash map and would like to validate that I am getting data, and if not that I provide a "Default value. I cannot get it to check properly if my hash has a value or not. For some reason the $NME is already returning true.  I am trying to account for cases where I don't have a match or the key NME doesn't exist. What am I missing (CID Is Empty works, NME isEmpty doesn't work/always returns true)?

 

#set($CID = ${lead.ID})
#set($NME = "$clinics.Map.get($CID).NME")

#if( $CID.isEmpty() || $NME.isEmpty() )
Physiotherapy
#else
$NME
#end

30 REPLIES 30