Skip to content

Commit a945dff

Browse files
authored
Update readme.md
1 parent 6845da8 commit a945dff

File tree

1 file changed

+8
-5
lines changed
  • Server-Side Components/Background Scripts/Duplicate Finder

1 file changed

+8
-5
lines changed

Server-Side Components/Background Scripts/Duplicate Finder/readme.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ A simple server-side script for ServiceNow that finds and reports on duplicate v
55
This script is designed to be run in **Scripts - Background** or as a Fix Script.
66
1. Navigate: Go to **System Definition > Scripts - Background** (or type sys.scripts.do in the filter navigator).
77
2. Copy Script: Copy the entire contents of the script.js file.
8-
3. Paste and Configure: Paste the script into the "Run script" text box. At the bottom, modify the function call to target your desired table and field:
8+
3. Paste and Configure: Paste the script into the "Run script" text box. Add the table to search in `tableName` and the field to search for duplicates in `fieldName`
99
```js
10-
// CONFIGURE YOUR QUERY HERE
11-
findDuplicates('your_table_name', 'your_field_name');
10+
// Update ONLY below values to find duplicates
11+
var tableName = '<table_name>'; // ADD: Table you want for duplicates
12+
var fieldName = 'field_name'; // ADD: Field that you want to check for duplicates
1213
```
1314
For example, to find duplicate email addresses in the User table:
1415
```js
15-
findDuplicates('sys_user', 'email');
16+
var tableName = 'sys_user';
17+
var fieldName = 'email';;
1618
```
1719
To find incidents with the same short description:
1820
```js
19-
findDuplicates('incident', 'short_description');
21+
var tableName = 'incident';
22+
var fieldName = 'short_description';
2023
```
2124

2225

0 commit comments

Comments
 (0)