Handling empty/zero values in Scripted Fields

Ok, you'll want to do something like this then:

if(doc.containsKey('actual') && doc.containsKey('expected')) {
  // do calculation
}
else {
  // return default value
}
1 Like