- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 07:20 PM
what is the glide aggregate function?how to use
Solved! Go to Solution.
- Labels:
-
Field Service Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 10:50 PM
Hi
Please try it in the background script :-
var count =new GlideAggregate('incident');
count.addAggregate('COUNT');
count.query();
var incidents =0;
if(count.next())
{
incidents = count.getAggregate('COUNT');
gs.print(incidents);
}
Copy paste this code in Background script.
See below :-
Regards,
Omkar Mone.
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 11:45 PM
after wrighting the business rule where should we see the result log

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 11:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 08:51 PM
Hi,
I hope following links will help you:
https://docs.servicenow.com/bundle/jakarta-application-development/page/script/glide-server-apis/concept/c_GlideAggregate.html
https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/script/glide_server_apis/reference/r_GlideAggregateExamples.html
Mark it helpful/correct if it helps.
Thanks,
Tejal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 09:37 PM
where should i wright these scripts?and the entire script i need to wright that you have given?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 09:48 PM
Hi,
GlideAggregate enables you to easily create database aggregation queries.
The scoped GlideAggregate class is an extension of GlideRecord and provides database aggregation (COUNT, SUM, MIN, MAX, AVG) queries. This functionality can be helpful when creating customized reports or in calculations for calculated fields. The GlideAggregateclass works only on number fields.
When you use GlideAggregate on currency or price fields, you are working with the reference currency value. Be sure to convert the aggregate values to the user's session currency for display. Because the conversion rate between the currency or price value (displayed value) and its reference currency value (aggregation value) might change, the result may not be what the user expects.
You can write this scripts in Business rule and its up to you what result you want which functions need for it.
Mark my answer as correct if it helps and close the thread so other can refer it.
Thanks ,
Tejal