what is the glide aggregate function?how to use

preddy1
Giga Expert

what is the glide aggregate function?how to use

1 ACCEPTED SOLUTION

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 :-

 

find_real_file.png

 

find_real_file.png

find_real_file.png

Regards,

 

Omkar Mone.

www.dxsherpa.com

View solution in original post

23 REPLIES 23

but i dont want to see on incident list.i want to see these in the logs is there any such thing is there to see the result

Hi 

I have posted the answer for the same above. Check in debug business rule.

Hi preddy,

If i have helped you in achieveing your requirement please mark my answer correct.

 

Regards. 

 

Hi 

You can write GlideAggregate in any business rule because it is an API which can be used to query daqtabase as GlideRecord does.

 

You can write it a Script include also or wherever there is a server side call you can make use of that AP.

For examples see the below link and try those in your background script for practise.

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/script/glide_server_apis/referenc...\

 

Mar correct if it helps and close the thread.

 

Regards,

Omkar Mone.

www.dxsherpa.com