Courseiva
User Interface DevelopmenthardMultiple ChoiceObjective-mapped

SNOW-CAD User Interface Development Practice Question

Exhibit

Refer to the exhibit.
```javascript
// UI Policy Condition Script
function onCondition() {
   return gs.getProperty('my.property') == 'true';
}
```

A UI Policy with the above condition script never evaluates to true. What is the issue?

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 should not be wrapped in a function; it should directly be the condition expression.

UI Policy condition scripts are evaluated as expressions; they should directly return the condition result without being wrapped in a function. The script must be a single expression that evaluates to true or false. Option A is incorrect because UI16 does not require AngularJS for UI Policy conditions; UI Policy conditions are still evaluated as standard scripts. Option B is incorrect because there is no evidence of a misspelling, and property names can contain dots. Option C is incorrect because gs.getProperty() is permitted and commonly used in UI Policy scripts.

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 condition must be written in AngularJS to work in UI16.

    Why it's wrong here

    UI Policies do not use AngularJS.

  • The property name is misspelled as 'my.property' but should be 'my_property'.

    Why it's wrong here

    There is no indication of a misspelling; the property may exist.

  • gs.getProperty() is not permitted in UI Policy scripts.

    Why it's wrong here

    UI Policy scripts run server-side and can use gs.

  • The script should not be wrapped in a function; it should directly be the condition expression.

    Why this is correct

    UI Policy condition scripts are evaluated as the script itself, not a function call.

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 →

How Courseiva writes practice questions · Editorial policy

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.