Find duplicate records in ServiceNow
Find duplicate records using GlideAggregate and groupBy
var importGR = new GlideAggregate('u_import');
importGR.addAggregate('COUNT', 'u_number');
importGR.addNotNullQuery('u_number');
importGR.groupBy('u_number');
importGR.addHaving('COUNT', '>', 1);
importGR.query();
while (importGR.next()) {
gs.log(importGR.u_number);
}
Comments
Post a Comment