- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 09:55 AM
var gr_agg = new GlideAggregate("cmn_location");
gr_agg.addEncodedQuery("name=Americas");
gr_agg.aggAggregate("COUNT");
gr_agg.query();
gr_agg.next();
var count = gr_agg.getAggregate("COUNT");
gs.info("count is " + count);
This returns null. I'm running it in a console script, in global scope. I've tried supplying a second param (null) to addAggregate().
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 10:45 AM
Seems like there is a typo in your script.
Replace
gr_agg.aggAggregate("COUNT");
With
gr_agg.addAggregate("COUNT");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 10:45 AM
Seems like there is a typo in your script.
Replace
gr_agg.aggAggregate("COUNT");
With
gr_agg.addAggregate("COUNT");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 11:57 AM
That's it, thank you!