Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Glide record location table and print all locations whose latitude are not empty and greater than 50

Helan
Tera Contributor
 
1 ACCEPTED SOLUTION

J Siva
Kilo Patron

Hi @Helan 
Try the below script.

var locationGr = new GlideRecord('cmn_location');
locationGr.addNotNullQuery('latitude');
locationGr.addQuery('latitude', '>', 50);
locationGr.query();
while (locationGr.next()) {
  gs.info(locationGr.getValue('name'));
}
 

Regards,
Siva

View solution in original post

5 REPLIES 5

J Siva
Kilo Patron

Hi @Helan 
Try the below script.

var locationGr = new GlideRecord('cmn_location');
locationGr.addNotNullQuery('latitude');
locationGr.addQuery('latitude', '>', 50);
locationGr.query();
while (locationGr.next()) {
  gs.info(locationGr.getValue('name'));
}
 

Regards,
Siva

Helan
Tera Contributor

Thank you @J Siva ! This worked

@Helan Glad it helped 

Helan
Tera Contributor

Thank you! This worked