diff --git a/Core ServiceNow APIs/GlideRecord/Compare_2_records/README.md b/Core ServiceNow APIs/GlideRecord/Compare_2_records/README.md index 07367d9014..f5e3e968e2 100644 --- a/Core ServiceNow APIs/GlideRecord/Compare_2_records/README.md +++ b/Core ServiceNow APIs/GlideRecord/Compare_2_records/README.md @@ -1,4 +1,4 @@ -# Compare Two Records Using GlideRecord (Global Scope) +# Comparing 2 records and identify differences This snippet compares two records from the same table in ServiceNow field-by-field using the **GlideRecord API**. It’s useful for debugging, verifying data after imports, or checking differences between two similar records. @@ -25,6 +25,7 @@ Run this script in a **Background Script** or **Fix Script**: compareRecords('incident', 'sys_id_1_here', 'sys_id_2_here', false); ``` --- + ## Example Output ```js short_description: "Printer not working" vs "Printer offline" diff --git a/Core ServiceNow APIs/GlideRecord/Compare_2_records/compareRecords.js b/Core ServiceNow APIs/GlideRecord/Compare_2_records/compareRecords.js index 2988299c0d..f13ec02742 100644 --- a/Core ServiceNow APIs/GlideRecord/Compare_2_records/compareRecords.js +++ b/Core ServiceNow APIs/GlideRecord/Compare_2_records/compareRecords.js @@ -1,4 +1,5 @@ /** + * Comparing 2 records and identify differences (GlideRecord) * Compare two records in a ServiceNow table field-by-field. * Logs all field differences between the two records, including display values. *