Courseiva

Using changes() and Accessing New Values in Business Rules

A developer is writing a business rule that should trigger on update of the 'short_description' field of an incident. The rule needs to check if the new value contains 'urgent' and, if so, set the priority to 1. Which TWO statements are true about implementing this rule?

⚠ Common exam trap

Test-takers frequently confuse `current` and `previous`—thinking `previous` holds the new value—or mistakenly use `setValue()` instead of direct assignment for GlideRecord fields.

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

The condition 'current.short_description.changes()' can be used to ensure the rule runs only when short_description changes.

The changes() method on a GlideElement returns true only when the field's value has been modified during the current transaction. Placing `current.short_description.changes()` in the business rule's condition ensures the rule triggers only when the short_description field is updated, not on other field changes. Option B is correct because `current` always holds the updated record after the database write; thus `current.short_description` contains the new value. Options C and D are incorrect: `previous.short_description` holds the old value before the update, and `setValue()` is not a method on GlideRecord fields—priority should be set by direct assignment (e.g., `current.priority = 1`). Option E is incorrect because `current.short_description` is a GlideElement object, not a plain string; the indexOf() method does not exist on GlideElement. To check for a substring, you must convert to string first, e.g., `current.short_description.toString().indexOf('urgent') !== -1`. Therefore, the two true statements are A and B.

Answer analysis

Option-by-option breakdown

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

  • The condition 'current.short_description.changes()' can be used to ensure the rule runs only when short_description changes.

    Why this is correct

    Correct. The changes() method on a GlideElement returns true only when the field's value has been modified during the current transaction.

  • The new value of short_description can be accessed using current.short_description.

    Why this is correct

    Correct. current holds the updated record, so current.short_description contains the new value.

  • The new value of short_description can be accessed using previous.short_description.

    Why it's wrong here

    Incorrect. previous.short_description holds the old value before the update.

  • To set the priority, use current.priority.setValue(1).

    Why it's wrong here

    Incorrect. GlideRecord fields are set by direct assignment (current.priority = 1), not by setValue().

  • The comparison should use current.short_description.indexOf('urgent') !== -1.

    Why it's wrong here

    Incorrect. current.short_description is a GlideElement object, not a string; indexOf() does not exist on it. Use toString() first.

About these practice questions

Courseiva writes every SNOW-CAD question from scratch — 481 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on SNOW-CAD

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. What is the effect of this business rule?

easy
  • A.It will cause an error because assignment_group is a reference field.
  • B.It only runs when both caller and short description change.
  • C.It sets assignment_group to 'IT Support' every time the caller or short description changes.
  • D.It only sets assignment_group when the incident is first created.

Why C: The business rule is configured to trigger 'on change' for both the 'caller' and 'short description' fields. When either field changes, the rule sets the 'assignment_group' field to 'IT Support'. This is a typical use of a business rule to automatically assign incidents based on field updates.

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.