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 write background script that will give you list of user whose location is empty

kusumgautam
Tera Contributor
 
1 ACCEPTED SOLUTION

SanjivMeher
Mega Patron
Mega Patron

You can create the query from the user list view and then use in a script

 

For ex

 

var user = new GlideRecord('sys_user');
user.addEncodedQuery('locationISEMPTY');
user.query();

while (user.next())
{
   gs.info('Location is empty for '+user.user_name);
}

Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

5 REPLIES 5

Thank you Sanjiv !!