How to find Duplicate records in a table?

var dupRecords = [];

var gaDupCheck1 = new GlideAggregate('sys_user'); gaDupCheck1.addAggregate('COUNT', 'email');

gaDupCheck1.groupBy('email');

gaDupCheck1.addHaving('COUNT', '>', 1);

gaDupCheck1.query();

while (gaDupCheck1.next()) {

dupRecords.push(gaDupCheck1.email.toString());

}

gs.print(dupRecords);


要查看或添加评论,请登录

Anshul Agarwal ???的更多文章

  • Understanding Custom Workspace ??

    Understanding Custom Workspace ??

    Creating a custom workspace in ServiceNow involves several steps, utilizing the Next Experience UI Builder and other…

  • Service Operations Workspace

    Service Operations Workspace

    ServiceNow's Service Operation workspace is designed to provide IT service management (ITSM) teams with a centralized…

    3 条评论
  • ??Leveraging AI for Enhanced ServiceNow Performance: A Game-Changer in IT Service Management??

    ??Leveraging AI for Enhanced ServiceNow Performance: A Game-Changer in IT Service Management??

    Harnessing AI for IT Service Management: ServiceNow serves as the backbone for IT service delivery in countless…

  • New to ServiceNow?

    New to ServiceNow?

    ??New to ServiceNow? No Worries – Dive into This Learning Guide ?? Learning ServiceNow can be a rewarding journey…

  • Revolutionizing Business Operations with ServiceNow

    Revolutionizing Business Operations with ServiceNow

    ?? Embracing Innovation for Seamless Workflows ?? In the fast-paced world of business, efficiency is key. That's where…

  • Add Bookmark for all users

    Add Bookmark for all users

    var bookmark = new GlideRecord('sys_ui_bookmark'); bookmark.newRecord(); bookmark.

  • How to find unique values in a table? ?

    How to find unique values in a table? ?

    function getUniqueValues(table, groupingAttribute, encodedQuery) { var uniqueValues = []; var ga = new…

社区洞察

其他会员也浏览了