SNOW-CAD Core Application Development Practice Question
A Script Include is defined as 'Scoped' and has 'Accessible from' set to 'All applications'. It contains a function that uses 'gs.getUser()'. When the Script Include is called from a Business Rule in a different application scope, what is the result?
⚠ Common exam trap
Watch out — candidates often confuse 'Accessible from' with runtime context, incorrectly assuming that a scoped Script Include runs in its own application scope and thus returns a different user, when in fact the session context is always preserved.
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 function runs successfully and gs.getUser() returns the current user from the caller's session.
A Script Include defined as 'Scoped' with 'Accessible from' set to 'All applications' is explicitly made available to other application scopes. When called from a Business Rule in a different scope, the function executes in the context of the caller's session, so `gs.getUser()` returns the current user from the caller's session, not from the Script Include's own scope. This behavior is governed by the scoping rules that allow cross-application access when the property is set accordingly.
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 function runs successfully and gs.getUser() returns the current user from the caller's session.
Why this is correct
Scoped Script Includes with 'All applications' access can be called from any scope, and gs APIs work globally.
- ✗
An error occurs because scoped Script Includes cannot be called from other applications.
Why it's wrong here
The 'Accessible from all applications' setting explicitly allows cross-scope calls.
- ✗
The function runs but gs.getUser() returns the user from the Script Include's application scope, not the caller.
Why it's wrong here
gs.getUser() returns the user of the current session, regardless of scope.
- ✗
The function runs but returns null because gs is not available in scoped applications.
Why it's wrong here
gs is available in all scoped applications.
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.