Courseiva
Self-Service and AutomationhardMultiple ChoiceObjective-mapped

SNOW-CSA Self-Service and Automation Practice Question

Exhibit

(function execute(inputs, outputs) {
    var gr = new GlideRecord('sys_user');
    gr.get('user_sys_id', inputs.user_sys_id);
    if (gr.isValidRecord()) {
        outputs.user_email = gr.email;
        outputs.user_department = gr.department;
    } else {
        outputs.error = 'User not found';
    }
})(inputs, outputs);

Refer to the exhibit. An administrator created the above Flow Designer action script to retrieve user details. When tested, the action returns 'User not found' for a valid user sys_id. What is the most likely cause?

⚠ Common exam trap

Watch out — candidates often confuse the `get()` method's signature, mistakenly thinking it requires a table name as the first argument (like `getTable()` or `addQuery()`), when in fact the table is already defined by the GlideRecord constructor.

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 get method should be called with one argument: the sys_id.

In GlideRecord, the `get()` method with a single argument (the sys_id) retrieves a record by its unique system identifier. The script incorrectly passes two arguments (`inputs.user_sys_id` and a table name), which causes the method to fail and return false, leading to the 'User not found' message. The proper syntax is `gr.get(inputs.user_sys_id)`.

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 script is missing a condition check.

    Why it's wrong here

    Wrong: The condition check is present after the get.

  • The variable 'inputs.user_sys_id' is not being passed correctly.

    Why it's wrong here

    Wrong: If the input was missing, the error would be different.

  • The 'get' method should use the first parameter as table name.

    Why it's wrong here

    Wrong: The table is already specified in the GlideRecord constructor.

  • The get method should be called with one argument: the sys_id.

    Why this is correct

    Correct: The correct syntax is gr.get(inputs.user_sys_id).

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.