SNOW-CSA UI, Navigation and Forms Practice Question
Exhibit
// UI Policy Condition Script current.state == 1 && current.caller_id.isValid()
Refer to the exhibit. A UI Policy is configured with the above condition script to make the 'work_notes' field mandatory when state is 1 and caller_id is valid. When the state is 1 and caller_id is empty, the mandatory attribute is not applied. What is the cause?
⚠ Common exam trap
ServiceNow exams often test the distinction between client-side and server-side scripting contexts in ServiceNow, and the trap here is that candidates assume `isValid()` is a generic JavaScript method available everywhere, when in fact it is a GlideRecord method restricted to server-side execution.
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 isValid() method is not available in UI Policy context
The `isValid()` method is a GlideRecord method that operates on the server side, not a client-side method available in UI Policy scripts. UI Policies run on the client side (in the browser), so `isValid()` is not defined in that context, causing the condition to fail silently or not behave as expected. This is why the mandatory attribute is not applied when `caller_id` is empty, even though the script intends to check for a valid record.
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 condition uses '&&' instead of '||'
Why it's wrong here
The AND condition is appropriate; if caller is invalid, the mandatory should not apply, but it fails to apply when caller is empty.
- ✗
There is a syntax error in the script
Why it's wrong here
The script has valid JavaScript syntax; the issue is functional.
- ✓
The isValid() method is not available in UI Policy context
Why this is correct
UI Policy scripts run client-side and cannot use server-side methods like isValid().
- ✗
The caller_id field is empty
Why it's wrong here
Empty caller_id is expected, but the condition should not make mandatory in that case; the issue is the method.
Go deeper
Related to this question
About these practice questions
One of 504 original SNOW-CSA 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-CSA 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-CSA exam.