Courseiva
Service Catalog and WorkflowshardMultiple ChoiceObjective-mapped

SNOW-CSA Service Catalog and Workflows Practice Question

Exhibit

{
    "activity": {
        "name": "Run Script",
        "script": "current.state = 'pending'; current.update();",
        "runScriptOn": "run"
    }
}

Refer to the exhibit. A workflow includes a 'Run Script' activity with the above configuration. What will happen when the workflow reaches this activity?

⚠ Common exam trap

Test-takers frequently assume 'current.update()' is optional or that 'current' is not available in workflow scripts, when in fact it is always available and update() is required to save changes.

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 script runs and updates the current record's state to pending.

The 'Run Script' activity in a ServiceNow workflow executes the provided script when the workflow reaches that activity. The script uses the 'current' GlideRecord object, which is automatically available in workflow scripts and represents the record that triggered the workflow. The 'current.state = 3' line sets the state field to the value for 'pending' (typically 3 in the standard incident or task table), and 'current.update()' commits this change to the database, so the record's state is updated to pending.

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 will cause an error because current is not defined in workflow.

    Why it's wrong here

    current is defined in workflow context.

  • The script runs but current.update() is unnecessary because state is set automatically.

    Why it's wrong here

    update() is needed to save changes to the database.

  • The script runs and updates the current record's state to pending.

    Why this is correct

    The script uses current to set state and update the record.

  • The script only runs when the workflow is started, not when the activity is reached.

    Why it's wrong here

    The script runs when the activity is reached, as configured.

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.