SNOW-CAD User Interface Development Practice Question
Exhibit
Refer to the exhibit.
Client script on a form:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
g_form.setValue('short_description', 'Category changed to ' + newValue);
}This client script is attached to the 'category' field on the incident form. When the user changes the category to 'Network', what happens to the short_description field?
⚠ Common exam trap
The trap here is that candidates may misinterpret the empty check as a guard that prevents any action when newValue is non-empty, but the script only skips if newValue is empty, so when newValue is 'Network', it proceeds to the equality check and executes the setValue call.
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 short_description is set to 'Category changed to Network'.
The client script checks if the newValue of the 'category' field is not empty and equals 'Network'. When the user changes the category to 'Network', newValue is 'Network', which passes the empty check (newValue !== ''), and then the condition newValue === 'Network' is true. The script then executes g_form.setValue('short_description', 'Category changed to Network'), which sets the short_description field to that string.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Nothing happens because newValue equals 'Network' which passes the empty check.
Why it's wrong here
newValue is not empty, so the condition fails and the setValue runs.
- ✓
The short_description is set to 'Category changed to Network'.
Why this is correct
The setValue method updates the field.
- ✗
An error occurs because setValue cannot be called with a string.
Why it's wrong here
setValue accepts a string.
- ✗
The short_description is cleared.
Why it's wrong here
The script sets a value, not clears.
Go deeper
Related to this question
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 →
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.