SNOW-CAD Designing interfaces and user experiences Practice Question
Exhibit
Refer to the exhibit.
// UI Script: myCustomUIScript
function onLoad() {
var priority = g_form.getValue('priority');
if (priority == '1') {
g_form.setValue('urgency', '1');
g_form.setValue('impact', '1');
}
}
// Client Script: onChange - priority
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '1') {
g_form.setValue('urgency', '1');
g_form.setValue('impact', '1');
}
}A developer created a UI Script and a Client Script as shown. Both scripts set urgency and impact to '1' when priority is '1'. However, when the priority is changed to '1' on an existing record, the urgency and impact fields do not update. What is the most likely cause?
⚠ Common exam trap
ServiceNow often tests the distinction between defining a script and executing it, trapping candidates who assume that simply creating a UI Script will automatically run it on field changes without an explicit trigger.
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 UI Script is not being called because it is not associated with any form or event
A UI Script is a reusable client-side script that must be explicitly called from a Client Script, UI Policy, or form event to execute. In this scenario, the UI Script is not associated with any form or event, so it never runs when the priority field changes. The Client Script alone cannot invoke the UI Script without a direct call, leaving the urgency and impact fields unupdated.
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 UI Script is not being called because it is not associated with any form or event
Why this is correct
UI Scripts are not automatically executed; they must be called from a Client Script or UI Policy.
- ✗
The priority field is not a choice field, so onChange does not fire
Why it's wrong here
onChange fires for any field change, not just choice fields.
- ✗
The Client Script function name is incorrect; it should be 'onChangePriority'
Why it's wrong here
The function name 'onChange' is correct for a client script of type onChange.
- ✗
The g_form API is deprecated and no longer works
Why it's wrong here
g_form is still valid in ServiceNow.
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.