Courseiva
Core Application DevelopmentmediumMultiple ChoiceObjective-mapped

SNOW-CAD GlideRecord Practice Question

A developer needs to create a scheduled job that runs every Monday at 8 AM to update all incidents with a priority of '1' that are still open. Which condition script should be used in the scheduled job?

⚠ Common exam trap

The trap is to select B because it also appears to filter correctly; however, in a single-select item the expected best practice is to use chained addQuery calls for programmatic queries rather than an encoded query string.

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

var gr = new GlideRecord('incident'); gr.addQuery('priority', 1); gr.addQuery('active', true); gr.query();

D is correct because it uses chained addQuery calls on a GlideRecord for the incident table to filter priority=1 and active=true, then executes the query to retrieve all matching records. Option A incorrectly uses GlideAggregate, which is intended for aggregation, not record retrieval. Option C incorrectly uses get with two arguments, which retrieves a single record and does not combine multiple conditions. Option B uses addEncodedQuery, which could produce the same results, but the single-answer item expects the standard programmatic approach using addQuery.

Answer analysis

Option-by-option breakdown

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

  • var gr = new GlideAggregate('incident'); gr.addQuery('priority', 1); gr.query();

    Why it's wrong here

    GlideAggregate is for aggregation, not for retrieving or updating records.

  • var gr = new GlideRecord('incident'); gr.addEncodedQuery('priority=1^active=true'); gr.query();

    Why it's wrong here

    addEncodedQuery can be used with an encoded query string, but it is not the expected single-answer choice for a programmatic GlideRecord query.

  • var gr = new GlideRecord('incident'); gr.get('priority', 1); gr.get('active', true);

    Why it's wrong here

    get() with field-value arguments retrieves one record and does not combine multiple conditions.

  • var gr = new GlideRecord('incident'); gr.addQuery('priority', 1); gr.addQuery('active', true); gr.query();

    Why this is correct

    Correct: chained addQuery calls retrieve all incident records with priority 1 and active true.

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.