Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Amit Gujarathi
Giga Sage
Giga Sage
Hi Friends , In this video we will try to understand the imense power of Servicenow Reporting | We will see how we ServiceNow call Script include in Reports. We will focus on the use case to generate ServiceNow Duplicate Records report | This tutorial includes powerful reporting tips and tricks. Use a script to find any "duplicate" records within your ServiceNow application. WHY WOULD YOU NEED THIS? One example might be duplicate user ids. Users may have duplicate user ids if the Transform Map is coalesced off another field other than User ID. This happens in corporate environments with multiple company mergers/partnerships where AD directories and user name rules are not combined or determined yet. Other times there might be a mistake in an import, discovery issue, customization mistake, or maybe you just need to find this out for a report. Regardless of the reason to find a "duplicate" record, these scripts may assist you. FIND DUPLICATE RECORDS WITH A BACKGROUND SCRIPT What I do to check for "duplicate" records most often is just to run a quick background script. This works great for testing your imports or helping to find a permanent fix to an existing issue. So lets first understand what is reports and script include ? Script includes Paris Script includes are used to store JavaScript that runs on the server. Create script includes to store JavaScript functions and classes for use by server scripts. Each script include defines either an object class or a function. Consider using script includes instead of global business rules because script includes are only loaded on request. Script include form Script includes have a name, description and script. They also specify whether they are active or not, and whether they can be called from a client script. To access script includes, navigate to System Definitions -- Script Includes. Use script includes Script includes are found under System Definition or System UI. You can call existing script includes from a script. To create an entirely new script include, you can follow the format of any of the existing script includes. In the example, the name of your Script Include is 'NewInclude' and there is a single function called 'myFunction.' It is important that the name of the script include match the name of the class, prototype, and type. When you create a new script include and give it a name, the system provides you a code snippet with the class and prototype set up properly. Reporting ServiceNow Reporting enables you to create and distribute reports that show the current state of instance data, such as how many open incidents of each priority there are. Reporting functionality is available by default for all tables, except for system tables.