SNOW-CAD Practice Question: Application development using ServiceNow Studio
A developer is troubleshooting a client script that hides a field on a form when a condition is met, but it is not working. The script is attached to the 'g_form' object in Studio. What is the most likely reason?
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 client script is set to run on the 'Load' event instead of 'Change'.
The most likely reason because client scripts that need to react to a condition change must be set to run on 'Change' event rather than 'Load'. If the script runs only on 'Load', it executes once when the form loads and will not re-run when the condition changes, so the field remains visible. Option B is incorrect because the API for hiding fields (e.g., g_form.setVisible) is not deprecated. Option C is incorrect because client scripts do not have a 'Run As' role; that applies to server-side scripts. Option D is incorrect because client scripts can access any field present on the form regardless of the field's scope.
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 client script is set to run on the 'Load' event instead of 'Change'.
Why this is correct
Correct. The script is attached to the Load event, so it only runs once when the form loads and does not re-evaluate when the condition changes. Changing the event to Change will fix it.
- ✗
The script is using a deprecated API.
Why it's wrong here
Incorrect. The API for hiding fields (g_form.setVisible) is not deprecated.
- ✗
The script is not running due to a missing 'Run As' role.
Why it's wrong here
Incorrect. Client scripts do not have a 'Run As' role; that is a server-side script feature.
- ✗
The field is not part of the application scope.
Why it's wrong here
Incorrect. Client scripts can access any field on the form regardless of the field's scope.
Go deeper
Related to this question
About these practice questions
This SNOW-CAD question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.