Tag: gliderecord
19 results
-
Find Filthy Inefficient Single-Record Queries FAST
A script that scans your instance for single-record GlideRecord queries missing setLimit(1) - the most common performance anti-pattern in ServiceNow.
-
Calculate Distance Between Two Locations in ServiceNow (without an API call!)
Calculate the distance between two ServiceNow cmn_location records using the Haversine formula. No API call needed - just lat/long.
-
How to Identify Duplicate Records by Multiple Fields in ServiceNow
Finding duplicate records when the "duplicate" is defined by a combination of multiple fields, not just one.
-
A Faster, More Efficient Client-side GlideRecord (Free tool!)
EfficientGlideRecord is a free, drop-in replacement for client-side GlideRecord that's up to 93% faster - no extra Script Include needed.
-
Using .addJoinQuery() & How to Query Records with Attachments in ServiceNow
Use addJoinQuery() to find records with attachments in ServiceNow. No loops, no extra queries - just one clean join.
-
How to Get and Parse ServiceNow Journal Entries as Strings/HTML
How to retrieve, parse, and format ServiceNow journal entries (comments and work notes) as strings or HTML in scripts and notifications.
-
Understanding Attachments in ServiceNow
Everything you need to know about working with attachments in ServiceNow - querying, copying, creating, and deleting them via script.
-
How to do Massive, Slow Database Operations Efficiently With Event-Driven Recursion
Use event-driven recursion to process thousands of slow database operations without hitting transaction limits or bogging down your instance.
-
Powerful Scripted Text Search in ServiceNow
How to perform IR_AND, IR_OR, and other text search operations from GlideRecord scripts in ServiceNow.
-
Avoiding Pass-By-Reference Using getValue() & setValue()
Why you should always use getValue()/setValue() instead of direct dot-walking assignment, and the gnarly pass-by-reference bugs you'll avoid.
-
Pro Tip: Use updateMultiple() for Maximum Efficiency!
Stop looping through records to update a single field. Use updateMultiple() instead - it's dramatically faster and your instance will thank you.
-
GlideRecord Pagination - Page through your GlideRecord query
A Script Include for paging through large GlideRecord queries in manageable chunks. Handy for REST APIs, UIs, and batch operations.
-
GlideRecord & GlideAjax: Client-Side Vs. Server-Side
Why client-side GlideRecord queries are a performance trap, and how GlideAjax moves that heavy lifting to the server where it belongs.
-
SN101: Boolean logic and ServiceNow's Condition Builder
A deep dive into boolean logic (AND/OR) and how it maps to ServiceNow's Condition Builder. Part of the SN101 series for newcomers.
-
Locate any record in any table, by sys_id in ServiceNow
A script that searches every table in your instance to find which record a mystery sys_id belongs to.
-
Detecting Duplicate Records with GlideAggregate
Using GlideAggregate to detect and report on duplicate records across any table in ServiceNow.
Tools
-
Detect Duplicates (Single or Multi-Field)
Identify duplicate records in ServiceNow by one or more fields using a simple script.
-
EfficientGlideRecord (Client-side)
A faster, drop-in replacement for the client-side GlideRecord API - up to 93% faster queries.
-
Paginated GlideRecord Utility
Page through GlideRecords to handle very large queries, build content pages, etc. This utility allows you to specify a page size (in number of records) and get the results of a query of ANY size, in chunks of that size.