LogiUpSkill

                                   Glide Aggregate

It is a server-side ServiceNow API, used to perform aggregate operations like COUNT, SUM, AVG, MIN, and MAX on table records without retrieving full record data 

Methods of Glide Aggregate -: 

  1. addAggregate(aggregate, fieldname)
    -> Adds an aggregate function like COUNT, SUM, AVG, MIN, MAX on a given field. 
  1. GroupBy
    -> Groups the records based on the supplied field. 
  1. Order By
    -> Sorts the result in ascending order. 
  1. OrderByDesc
    -> Sorts the result in descending order by the given field. 
  1. query()
    -> Executes the database query. 
  1. next ().
    -> Moves to the next aggregated record. 
  1. GetAggregate.
    -> Gives you the final calculated answer (like total count or total sum).

     

  2. GetValue.
    -> Gives you the value stored in a field for that record.

     

  3. addEncodedQuery(query String)- 
    -> Adds a ready-made filter to get only the records you want.

     

  4. setGroup(Boolean)
    -> Tells the system to group similar records together.

     

  5. SetHavingCondition
    -> Filters the grouped results based on total/count/sum values.

     

  6. SetLimit.
    -> Tells the system to return only a limited number of records. 

Example -:  

 1). Using GlideAggregate in ServiceNow, how many incidents are grouped by category? 

Output -: 

2. To find number of incidents active true 

Output -: 

Glide Aggregate

Leave a Reply

Your email address will not be published. Required fields are marked *