From 39b0e6fca78600f24a1c89bb5450695cffb2183a Mon Sep 17 00:00:00 2001 From: JAHNAVI THONDEPU <95975610+jahnaviT2003@users.noreply.github.com> Date: Sat, 18 Oct 2025 18:55:42 +0530 Subject: [PATCH 1/2] countRecords.js --- .../GlideQuery/Count Records/countRecords.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Core ServiceNow APIs/GlideQuery/Count Records/countRecords.js 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): +})(); From 304755b093ab108b8c07869112c0180b4cf7b49e Mon Sep 17 00:00:00 2001 From: JAHNAVI THONDEPU <95975610+jahnaviT2003@users.noreply.github.com> Date: Sat, 18 Oct 2025 19:03:59 +0530 Subject: [PATCH 2/2] Create README.md --- Core ServiceNow APIs/GlideQuery/Count Records/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Core ServiceNow APIs/GlideQuery/Count Records/README.md 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