SNOW-CAD Working with Data Practice Question
Exhibit
function transformEntry(source, target) {
if (source.u_department != '') {
target.department = source.u_department;
}
}Refer to the exhibit. What is the purpose of this transform script?
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
✓
To map the department field only if source department is not empty.
The transform script maps the 'department' field only if the source field 'u_department' is not empty, as indicated by the conditional logic. Option A is incorrect because the script does not ignore records; it only skips mapping for empty departments. Option C is incorrect because no default value is set; the field is simply not mapped if empty. Option D is incorrect because only the department field is mapped conditionally, not all fields.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
To ignore records with empty department.
Why it's wrong here
The script does not skip records; it only skips the mapping for that field.
- ✓
To map the department field only if source department is not empty.
Why this is correct
The if condition ensures mapping only when source has a value.
- ✗
To set a default value for the department field.
Why it's wrong here
The script does not set a default; it maps conditionally.
- ✗
To map all fields from source to target.
Why it's wrong here
The script only handles one field.
Go deeper
Related to this question
About these practice questions
One of 481 original SNOW-CAD 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-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.