SNOW-CAD User Interface Development Practice Question
A Service Portal widget is not rendering on the page, and the browser console shows: 'Uncaught ReferenceError: sp is not defined'. The widget's client script uses 'sp.get()'. What is the cause?
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 widget's client controller does not include 'sp' in the dependency list
The user sees an error 'sp is not defined' because the client script uses 'sp.get()' but 'sp' is not available. In Service Portal, the 'sp' API must be explicitly injected into the widget's client controller. If it is not listed in the dependencies of the client controller function, the script will not have access to 'sp'. Therefore, Option B is correct. Option A is incorrect because the order of widgets on the page does not affect dependency injection for individual widgets. Option C is incorrect because 'angular' is not required for 'sp'; it is the Service Portal API that needs to be injected. Option D is incorrect because there is no race condition; the server script runs first and does not affect the client-side dependency injection.
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 widget is placed before the 'sp' provider widget on the page
Why it's wrong here
Widgets on a page are independent; dependencies must be declared in the widget record.
- ✓
The widget's client controller does not include 'sp' in the dependency list
Why this is correct
In Service Portal, client controllers must list 'sp' as a dependency to use the sp API.
- ✗
The widget is missing a dependency on 'angular'
Why it's wrong here
The 'sp' API is separate from Angular; it is provided by the portal framework.
- ✗
The server script runs after the client script, causing a race condition
Why it's wrong here
Server scripts run before client scripts; the error is about 'sp' being undefined, not timing.
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.