Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to check if an integer field is blank

yundlu316
Kilo Guru

Hi Everyone, I'm pretty sure this is a simple and idiotic question, but I can't seem to get anything to work.   I'm trying to write a calculated field that checks to see if an integer field is null.   I've tried = "", isnil(), nil(), but none of those work.   Here is my calculated field:

if (current.u_deductions_adjustments_10.isnil())   {

current.u_two_earners_1 = current.u_personal_allowance_h;}

else {current.u_two_earners_1 = current.u_deductions_adjustments_10;}

Thanks!

1 ACCEPTED SOLUTION

kitcorry
ServiceNow Employee
ServiceNow Employee

In javascript you can just say:



if (!current.u_deductions_adjustments_10)


View solution in original post

3 REPLIES 3

kitcorry
ServiceNow Employee
ServiceNow Employee

Did you try "== null"


kitcorry
ServiceNow Employee
ServiceNow Employee

In javascript you can just say:



if (!current.u_deductions_adjustments_10)


Thanks Kit, that did it!