ServiceNow UI policies & UI actions
Control form behaviour without code, and add buttons that run logic.
A ServiceNow UI policy makes fields mandatory, visible or read-only when a condition holds, declaratively, on every form, running after client scripts and able to override them. A UI action adds a button, link or context-menu item that runs server code with current in scope, or client code with the Client checkbox. Policy for field state, action for operations.
- UI policy: no-code form control
- UI action: buttons that do things
- When to use which
- Try it Yourself
UI policies and UI actions are two of the most-used configuration tools on the platform. A UI policy changes how a form behaves, which fields are mandatory, visible or read-only, declaratively, no code required. A UI action adds a button, link or context-menu item that runs logic when clicked.
UI policy: no-code form control
Define a condition (e.g. Category is Hardware) and the platform enforces the resulting field states automatically, on the client, everywhere the form appears. UI policies run after and can override client scripts, so prefer them for simple show/hide/mandatory.
When to use which
- UI policy, field must be mandatory/hidden/read-only under a condition.
- UI action, user needs to trigger an operation (approve, escalate, generate).
- Client script, you need custom logic on load/change that a UI policy can't express.
▸ Press Run to execute.
Runs in a sandbox in your browser. Mock gs and GlideRecord and sample data are provided.