Use addNullQuery(x) in favour of addQuery(x, '') in ServiceNow

Опубликовано: 09 Июль 2026
на канале: ServiceNerd
679
14

When doing a glideRecord query in ServiceNow, try using addNullQuery() instead of of addQuery(x, ''). It will save you a couple of milliseconds but also score you major nerd points with your ServiceNow Developer buddies.
:)

var target = new GlideRecord('incident');
target.addNullQuery('short_description');
target.query(); // Issue the query to the database to get all records
while (target.next()) {
// add code here to process the incident record
}

https://developer.servicenow.com/dev....#r_GlideRecord-AddNullQuery_String?navFilter=addnu

#servicenerd
#servicenow