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
- 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.
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.
| Part | What it does |
|---|---|
| Table | The form the policy applies to |
| Short description | A name that explains the purpose |
| Conditions | The rule that decides when the policy is true |
| UI Policy Actions | Per field: Mandatory, Visible, Read only (set to True, False or leave alone) |
| Reverse if false | Undoes the actions when the condition becomes false |
| On load | Evaluates the condition when the form opens, not only when a field changes |
| Global / View | Applies to all views, or only to a chosen form view |
| Order | Decides 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
| Situation | UI policy applies? |
|---|---|
| Form edited in the browser | Yes |
| Editing a value in a list | No |
| Data loaded by an import set | No |
| Record changed by a web service or a script on the server | No |
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
| Requirement | Best fit |
|---|---|
| Make a field mandatory or hidden on the form based on a condition | UI policy |
| Enforce a mandatory or read-only rule everywhere, including imports and web services | Data policy |
| Control who may read or write a record or field | ACL |
| Complex form behavior that needs logic, such as a calculation | Client 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.
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.