Group by count is different from list view vs glide aggregate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 11:44 PM - edited 05-08-2023 11:44 PM
I have a Glideagrregate logic that I'm using to remove duplicates on a reference field , the filters used makes sure that it doesn't have any empty values. When I copy the same filter used in list view ans paste it in a ascript , the records show more count.
5212 in list view vs 5750 in glide aggregate.
This is working as expected on some other filters with few records and no duplicates
var grCi = new GlideAggregate(TABLENAME);
grCi.addEncodedQuery('configuration_item.environmentINProduction^configuration_item.install_status=1^configuration_item.sys_class_name=cmdb_ci_db_mssql_catalog^configuration_item.support_group=c42b9969db867688c82df9fdbf961931');
grCi .groupBy('configuration_item');
grCi .query();
while (grCi .next()) {
inScopeCis.push(grCi .configuration_item.toString());
}
I saw the below KB , but this doesn't see applicable as my CI doesnt have empty record and it works on other filters
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0720019
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 01:51 AM
Hi,
My guess would be that GlideAggregate is acting like GlideRecord (GLIDERECORD VS GLIDERECORDSECURE) and ignoring ACLs. If you try using the same query with GlideRecordSecure and get a rowcount, I suspect you will see the lower count - which would confirm your GlideRecord is returning rows that ACLs exclude from the list query.
hth,matt