Data Migration and Integration · Topic 1 of 4

UI Policies

ServiceNow UI policies: conditions, mandatory, visible and read only actions, reverse if false, order, and how they differ from data policies and ACLs.

  • 4 min
In a nutshell
  • UI policies are client-side and run in the browser.
  • Actions are Mandatory, Visible and Read only.
  • Reverse if false undoes the actions when the condition stops being true.

What it is

A UI policy changes how a form behaves in the browser without writing code. When its condition is met, it can make fields mandatory, visible or read only.

UI policies run on the client side, in the user's browser. That one fact explains almost every exam question about them, including what they cannot do.

User opens or edits formCondition checkedin the browserTrueField actions appliedmandatory, visible, read only

How it works

Creating a UI policy

You find them under System UI > UI Policies. A policy belongs to a table and has a condition, a set of field actions, and optional scripts.

PartWhat it does
TableThe form the policy applies to
Short descriptionA name that explains the purpose
ConditionsThe rule that decides when the policy is true
UI Policy ActionsPer field: Mandatory, Visible, Read only (set to True, False or leave alone)
Reverse if falseUndoes the actions when the condition becomes false
On loadEvaluates the condition when the form opens, not only when a field changes
Global / ViewApplies to all views, or only to a chosen form view
OrderDecides which policy runs first when several apply

Reverse if false

With Reverse if false selected, a field made mandatory when Priority is 1 goes back to optional when Priority changes. Without it, the field stays as the policy left it.

This is the standard way to make a field "required only when" something is true.

Order of execution

If two policies act on the same field, the one with the higher Order value runs later, so it has the final say. A policy with Order 200 overrides a conflicting one with Order 100.

Scripts in a UI policy

A policy can also run client-side scripts. Select Run scripts and write one script for when the condition is true and another for when it is false. This is useful when the declarative actions are not enough, but the exam prefers the no-code actions where they fit.

What a UI policy cannot do

SituationUI policy applies?
Form edited in the browserYes
Editing a value in a listNo
Data loaded by an import setNo
Record changed by a web service or a script on the serverNo

Because it only controls the form, a UI policy is not security. A user who edits a value in a list, or a script that updates the record, goes around it.

UI policy, data policy, ACL or client script

RequirementBest fit
Make a field mandatory or hidden on the form based on a conditionUI policy
Enforce a mandatory or read-only rule everywhere, including imports and web servicesData policy
Control who may read or write a record or fieldACL
Complex form behavior that needs logic, such as a calculationClient script

A data policy can be set to also apply as a UI policy on the client, giving one rule for both places.

How the exam asks about this

  • "Require a Close notes field when State is Closed, but only on the form." Use a UI policy with a mandatory action.
  • "The field must also be required for records loaded through an import." A data policy, because UI policies do not run there.
  • "Two UI policies conflict on the same field." The one with the higher Order runs later and wins.

What to remember for the exam

  • UI policies are client-side and run in the browser.
  • Actions are Mandatory, Visible and Read only.
  • Reverse if false undoes the actions when the condition stops being true.
  • Higher Order runs later and wins in a conflict.
  • UI policies do not apply to list editing or import sets; data policies can enforce rules there.
  • Use a UI policy before writing a client script when no logic is needed.
Watch out

A UI policy is not a security control. If a question asks to protect data from being changed by anyone, the answer is an ACL, not a UI policy.

Common mistakes

Expecting a UI policy to protect imported data. Imports and list edits skip the form entirely, so mandatory rules must be set up as a data policy.

Forgetting Reverse if false. The field remains mandatory after the condition clears, which confuses users.

Writing a client script for a simple requirement. Showing, hiding or requiring a field based on a condition is exactly what a UI policy is for.

Check yourself

  • Where does a UI policy run?

    On the client side, in the user's browser, while the form is open.

  • Which feature enforces a mandatory field during an import?

    A data policy, because UI policies do not apply to imports.

  • Two UI policies set the same field differently. Which wins?

    The one with the higher Order value, because it runs later.

Topic 1 of 4 in Data Migration and Integration

Test yourself on Data Migration and Integration

The full ServiceNow CSA question bank has 600 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by ServiceNow. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.