diff --git a/Core ServiceNow APIs/GlideQuery/Count Records/README.md b/Core ServiceNow APIs/GlideQuery/Count Records/README.md new file mode 100644 index 0000000000..32e49980e1 --- /dev/null +++ b/Core ServiceNow APIs/GlideQuery/Count Records/README.md @@ -0,0 +1 @@ +This simple code snippet replaces the multi-line GlideRecord count with a one-liner diff --git a/Core ServiceNow APIs/GlideQuery/Count Records/countRecords.js b/Core ServiceNow APIs/GlideQuery/Count Records/countRecords.js new file mode 100644 index 0000000000..0e6dc3d4bc --- /dev/null +++ b/Core ServiceNow APIs/GlideQuery/Count Records/countRecords.js @@ -0,0 +1,6 @@ +(function() { + var openCount = new GlideQuery('incident') + .where('active' true) + .count(); + gs.info('Open Incidents: ' + openCount): +})();