serviceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Difference Between ServiceNow Data policy and UI policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @satishdbira
To Understand the difference - UI Policy controls how fields behave on a form for end users. It runs on the client side and can make fields mandatory, read-only, or visible/hidden based on conditions.
A Data Policy enforces data validation at the platform level. It runs on the server side and helps maintain data integrity regardless of how the record is created or updated
Example: If an Incident is moved to Closed:
A UI Policy can make Close Notes mandatory on the form.
A Data Policy ensures Close Notes is required even when the record is updated through an import or integration.
In short:
UI Policy = Form behavior
Data Policy = Data validation and integrity across all data sources.
If you found this useful, feel free to mark it as Accept as Solution and Helpful. It makes my day (and helps others too 😉).
Regards,
- Ankit
LinkedIn: https://www.linkedin.com/in/sharmaankith/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @satishdbira
| Feature | UI Policy | Data Policy |
| Execution Layer | Client-side (runs in the user's browser) | Server-side (runs at the database level) |
| Primary Purpose | Improve user experience by dynamically showing/hiding or enabling/disabling fields. | Ensure data consistency , data integrity across all entry points and mandate fields across the entire platform. |
| Applicability | Only works when users interact with the platform through the standard Form UI. | Works for all data sources: Forms, Web Services (APIs), Import Sets, and Background Scripts. |
| Field Visibility | Can show or hide fields on a form. | Cannot hide or show fields; can only make them mandatory or read-only. |
| Bypassable | Yes. Since it's client-side, users can sometimes bypass it using scripts, imports, or API integrations. | No. Data entering the database must adhere to the policy, making it highly secure and reliable. |
Refer: Difference between Data policy and UI policy
https://www.servicenow.com/community/developer-forum/ui-policy-vs-data-policy/td-p/3453864
https://www.servicenow.com/community/developer-forum/ui-policy-vs-data-policy/m-p/2948423
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi there @satishdbira
May i now why this question? its pretty much available all over the internet with Realtime examples too.
Kind Regards,
Azar
Serivenow Rising Star ⭐
Developer @ KPMG.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello @satishdbira ,
I have outlined some differences between UI Policy and Data Policy below.
UI Policy
UI Policy is client-side and is used for configuration such as Read-only, Mandatory, and Visible fields.
We can write scripts in UI Policies for additional modifications.
UI Policies are applied only on UI forms.
UI Policies do not apply to onCellEdit actions (List view editing).
To convert a UI Policy to a Data Policy, the following conditions must be met:
i) Global checkbox should be checked
ii) There should be no visibility actions
iii) Run scripts checkbox should be unchecked
Data Policy
In Data Policy, there are only options for Read-only and Mandatory.
Data Policies run on the server side, meaning they are enforced when data is inserted or updated in the database (table).
There is no option to write scripts in Data Policies.
Data Policies are applied even when data is inserted through Import Sets, Mobile UI, Web Services (API), or integrations.
- For data policy to ui policy conversion there is no any pre-requisit.
(Note - to disble data policy during modifying/creating record using script like gliderecord we need set gr.setUseEngine(false))
If this helps you then mark it as helpful accept as solution.
Regards,
Aditya,