SNOW-CAD Core Application Development Practice Question
A junior developer is creating a new catalog item for requesting software licenses. The catalog item includes several variables such as software name, quantity, and cost center. The business requires that when a user submits the request, the cost center variable should automatically populate with the cost center of the user's manager. The developer has written a script in the 'On Load' catalog client script to populate the cost center field. However, during testing, the cost center field remains empty after the form loads. The developer checks the script and finds it uses GlideAjax to call a Scripted REST API to fetch the manager's cost center. What is the most likely cause of the issue?
⚠ Common exam trap
ServiceNow often tests the asynchronous nature of GlideAjax in client scripts, tricking candidates into thinking the issue is a missing callback or a permission problem, when the real flaw is the timing of the response relative to the form load.
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 'On Load' client script runs before the GlideAjax response is received.
The 'On Load' catalog client script triggers when the form loads, but GlideAjax makes an asynchronous call to the server. The script continues executing without waiting for the response, so the cost center variable remains empty until the callback fires. Since the callback updates the field asynchronously, the field appears empty on load because the response hasn't arrived yet.
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 cost center variable is read-only and cannot be set by client scripts.
Why it's wrong here
Incorrect: If read-only, it wouldn't be empty; it would ignore the set, but likely not the issue.
- ✗
The Scripted REST API is not accessible from client scripts due to cross-origin restrictions.
Why it's wrong here
Incorrect: GlideAjax works within ServiceNow without CORS issues.
- ✗
The GlideAjax call is missing the callback function.
Why it's wrong here
Plausible but not most likely; the callback could exist but still timing issue.
- ✓
The 'On Load' client script runs before the GlideAjax response is received.
Why this is correct
Correct: The script sets the field value before the async response returns.
Visual reference
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.