Courseiva

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

A developer is creating a business rule that should run after a record is inserted or updated. The script should fire on both insert and update. Which condition should be used?

⚠ Common exam trap

Watch out — candidates often choose Option B because it explicitly lists both conditions, not realizing that the `in` operator is the preferred and more concise syntax in ServiceNow, or they pick Option D because they forget to exclude 'delete' from the list.

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

current.operation() in ['insert','update']

The `in` operator checks if `current.operation()` matches any value in the list `['insert','update']`, which is the exact requirement for a business rule that should fire on both insert and update. This is the most concise and idiomatic way in ServiceNow to test for multiple operation types.

Answer analysis

Option-by-option breakdown

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

  • current.operation().indexOf('insert') != -1

    Why it's wrong here

    This does not correctly check for both operations.

  • current.operation() == 'insert' || current.operation() == 'update'

    Why it's wrong here

    This works but is less readable than using the 'in' operator.

  • current.operation() in ['insert','update']

    Why this is correct

    This is the recommended way to check multiple operations.

  • current.operation() in ['insert','update','delete']

    Why it's wrong here

    This includes delete, which is not required.

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.