Courseiva

SNOW-CAD Practice Question: Automating application logic with business rules and scripts

Which TWO statements are true about using GlideAggregate in business rules?

⚠ Common exam trap

Watch out — candidates often confuse GlideAggregate's addField() with GlideRecord's addField() for retrieving field values, not realizing that in GlideAggregate, addField() is used for grouping and does not return raw non-aggregated data.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

GlideAggregate can be used to perform SQL-like GROUP BY operations.

GlideAggregate extends GlideRecord and allows performing SQL-like GROUP BY operations on database queries, enabling aggregation of data such as sums, counts, averages, etc. Option C is correct because GlideAggregate can be instantiated and used within a business rule to compute aggregated values from the database, which is a common pattern for server-side calculations.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • GlideAggregate allows adding non-aggregated fields to the result set using addField().

    Why it's wrong here

    addField() is used to specify fields to group by, not to add non-aggregated fields; all selected fields must be in GROUP BY or aggregate function.

  • GlideAggregate can be used to perform SQL-like GROUP BY operations.

    Why this is correct

    GlideAggregate is designed to perform grouping and aggregate functions like count, sum, min, max.

  • GlideAggregate can be used inside a business rule to compute values.

    Why this is correct

    Business rules can use GlideAggregate to query and aggregate data from the database.

  • GlideAggregate automatically orders the results by the aggregated field.

    Why it's wrong here

    GlideAggregate does not automatically order results; you must use addOrderBy() to specify ordering.

  • GlideAggregate can only be used in client scripts.

    Why it's wrong here

    GlideAggregate is a server-side class for performing database aggregation queries (SUM, COUNT, AVG) and cannot be instantiated in client scripts, which lack server-side execution context. It is tempting because GlideAggregate resembles GlideRecord, which is commonly used in both client and server scripts, leading to the mistaken assumption that aggregation methods share the same scope. In scenarios requiring client-side data summaries, a GlideAjax call to a Scripted REST API or a business rule would be the correct approach.

About these practice questions

One of 481 original SNOW-CAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SNOW-CAD practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CAD exam.