SNOW-CAD Practice Question: Application development using ServiceNow Studio
A developer is building a custom application in ServiceNow Studio for IT asset management. The application includes a table 'Asset' with fields: asset_tag (string), serial_number (string), purchase_date (date), cost (currency), and status (choice: In Use, In Stock, Retired). The developer needs to create a business rule that automatically sets the status to 'Retired' when the cost is zero and the purchase_date is older than 5 years. The business rule should run before the record is saved to the database and should not prevent the save if conditions are not met. The developer writes the following business rule in Studio: Table: Asset, When: Before, Order: 100, Condition: current.cost == 0 && current.purchase_date < gs.yearsAgoStart(5). The script is: current.status = 'Retired'; However, the status is not being updated as expected. What is the most likely issue?
⚠ Common exam trap
Test-takers frequently confuse `gs.yearsAgoStart()` and `gs.yearsAgoEnd()` with `gs.yearsAgo()`, not realizing that the 'Start' and 'End' variants are for fiscal or calendar year boundaries, not for exact date arithmetic.
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
✓
Replace gs.yearsAgoStart(5) with gs.yearsAgo(5) to get the exact date 5 years ago.
The issue is that `gs.yearsAgoStart(5)` returns the start of the year (January 1st) five years ago, not the exact date five years ago. This means a record with a purchase_date that is, for example, 5 years and 1 month old might still be after that start-of-year date and thus not match the condition. The correct method is `gs.yearsAgo(5)`, which returns the exact date and time five years ago, ensuring the comparison works as intended for any purchase_date older than 5 years.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Replace gs.yearsAgoStart(5) with gs.yearsAgoEnd(5) to get the end of the year 5 years ago.
Why it's wrong here
gs.yearsAgoEnd(5) returns the last day of the year 5 years ago, which is not what is needed.
- ✗
Change the table from 'Asset' to 'Asset [new]' as the business rule may be on the wrong table.
Why it's wrong here
The table name 'Asset' is correct; changing it would break the rule.
- ✗
Increase the order of the business rule to 200 to ensure it runs after other rules.
Why it's wrong here
The order does not affect the logic; the condition is the issue.
- ✓
Replace gs.yearsAgoStart(5) with gs.yearsAgo(5) to get the exact date 5 years ago.
Why this is correct
gs.yearsAgo(5) returns the date exactly 5 years before the current date, which correctly implements 'older than 5 years'.
Go deeper
Related to this question
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 →
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.