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.

Current.xxx returned string "null" in business rule

PhoenixMing0912
Giga Expert

Hi all,

I am using current.xxx or current.getValue("xxx") in business rule for getting a reference field.

The reference field was set to empty, however, I got a string "null" so that I cannot use some function to check if the field was empty, because a string "null" is also "has value".

How to check a reference field is empty in the business rule?

 

Regards,
Ming

7 REPLIES 7

Mahesh Kumar3
Giga Guru

Did you try gs.nil(current.xxx)

 

find_real_file.png

The problem here is the string is not an empty string, the value is "null" (not the keyword null).

Then check like this:

if((!gs.nil(current.xxx)) && (current.xxx != "null")){

// write your logic

}