- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2022 04:40 AM
Hello, I need to build a report which would filter our users who have identical names, but different UserIDs. Using the GlideAggregate I was able to print them out through a background script (unless something is incorrect in my code):
var duplicateUsers = new GlideAggregate('sys_user');
duplicateUsers.groupBy('name');
duplicateUsers.addHaving('COUNT', '>', 1);
duplicateUsers.query();
gs.info(duplicateUsers.getRowCount());
while (duplicateUsers.next()) {
gs.info('Users with the same name: ' + duplicateUsers.name);
}
How can I achieve the same in a simple report? I dont have the option to group users where COUNT > 1. Any tips on how to achieve this?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2022 06:25 AM - edited ‎10-24-2022 06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2022 06:25 AM - edited ‎10-24-2022 06:25 AM
This is the best solution I've seen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2022 01:00 AM
Thanks @Mike_R that seem to have solved my issue.