SNOW-CAD User Interface Development Practice Question
A ServiceNow developer is tasked with improving the performance of a custom incident form in the classic UI. The form includes a 'category' field that, when changed, triggers an onChange client script. This script uses a GlideRecord query to fetch related data from a large 'cmdb_ci' table (over 100,000 records) and populates a dependent field called 'subcategory' with relevant options. Users report that after selecting a category, the form freezes for 10-15 seconds before the subcategory field updates. The developer needs to maintain real-time updates based on the category selection. What is the best approach to resolve this performance issue while keeping the functionality?
⚠ Common exam trap
A common mix-up: candidates choose UI Policy (Option A) thinking it can run server-side logic, but UI Policies are purely client-side and cannot execute GlideRecord queries, leading to a misunderstanding of their scope.
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 the client script with a Scripted REST API that returns subcategory options, and make an asynchronous AJAX call from the client script to populate the field.
It offloads the heavy GlideRecord query from the client to the server via a Scripted REST API, while using an asynchronous AJAX call (e.g., GlideAjax) to avoid blocking the UI thread. This eliminates the 10-15 second freeze by preventing synchronous server-side processing on the client, maintaining real-time updates without freezing the form.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Convert the onChange script to a UI Policy with a condition on category and a script action to perform the query.
Why it's wrong here
Wrong: UI Policy scripts still run client-side and would have the same synchronous blocking issue.
- ✗
Use a calculated field on the subcategory field that derives its value from a database view.
Why it's wrong here
Wrong: Calculated fields are for simple expressions, not for populating choice lists or running GlideRecord queries.
- ✓
Replace the client script with a Scripted REST API that returns subcategory options, and make an asynchronous AJAX call from the client script to populate the field.
Why this is correct
Correct: async AJAX avoids blocking the UI; server handles the heavy query.
- ✗
Move the query to a Business Rule that runs on 'before' and updates the subcategory field using setValue.
Why it's wrong here
Wrong: Business Rule runs server-side but cannot directly update a client-side choice list; would require additional client mechanism.
Visual reference
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.