Courseiva
Reporting, SLA and ImportshardMultiple ChoiceObjective-mapped

SNOW-CSA Reporting, SLA and Imports Practice Question

Exhibit

Refer to the following transform map script:

(function executeTransformMap(source, target, log) {
    if (!source.u_employee_id) {
        return false;
    }
    if (target) {
        target.u_department = gs.getUser().getDepartment();
    }
    return true;
})(source, target, log);

What is the effect of this script on the import transform?

⚠ Common exam trap

Test-takers frequently assume the script sets the department for all records (including new ones) or that skipping records without an employee ID applies to both inserts and updates, when in fact the script only applies the department change to existing records being updated.

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

It will skip records that have no employee ID and set department for existing records only.

The script uses `source.u_employee_id.nil()` to check if the employee ID field is empty. If it is nil, the script returns `false`, which causes the import transform to skip that record entirely (no insert or update). For records with an employee ID, the script then checks `action == 'update'` and only sets the department to the current user's department for existing records being updated. New records (action 'insert') are not affected, so the department field remains unchanged for them.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • It will set the department to the current user's department for all imported records.

    Why it's wrong here

    The script only sets department when target exists (updates), not for new records (target is null).

  • It will cause an error because the target might be null.

    Why it's wrong here

    The script handles null target by checking if (target) first, so no error occurs.

  • It will skip records without employee ID and prevent updating department for new records.

    Why it's wrong here

    While it skips records without employee ID, it does update department for existing records; it does not prevent updates.

  • It will skip records that have no employee ID and set department for existing records only.

    Why this is correct

    The return false on empty employee ID causes the row to be skipped. The department assignment only happens when target is not null (existing record).

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 →

How Courseiva writes practice questions · Editorial policy

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.