UI policy vs Data Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Can anyone tell me difference between UI policy and Data Policy?, and also Best Practices while defining them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
@Prathmeshdagade UI Policy is to control visibility on the UI form and Data policy is to control the Data entered into a field.
Create couple of them and you will get it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Prathmeshdagade ,
you can refer these
https://www.servicenow.com/community/developer-forum/ui-policy-vs-data-policy/m-p/2948423
https://www.youtube.com/watch?v=oBMvydB1oGo
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @Prathmeshdagade ,
I have outlined some differences between UI Policy and Data Policy below.
UI Policy
UI Policies are client-side and are mainly used to configure Read-only, Mandatory, and Visible fields.
Scripts can be written inside UI Policies for additional client-side logic.
UI Policies are applied only on UI forms.
UI Policies do not work for onCellEdit (list view editing).
UI Policy =>Data Policy Conversion (Prerequisites)
To convert a UI Policy into a Data Policy, the following conditions must be met:
Global checkbox must be checked
No visibility actions should be present
Run scripts checkbox must be unchecked
Data Policy
Data Policies support only Read-only and Mandatory actions.
Data Policies run on the server side, so they are enforced during insert or update operations in the database.
Scripting is not supported in Data Policies.
Data Policies apply to records created or modified via:
Import Sets
Mobile UI
Web Services / APIs
Integrations
Data Policy =>UI Policy Conversion
There are no prerequisites for converting a Data Policy into a UI Policy.
(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,
Technical Consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
UI Policy works only client side and Data policy works both client side and server side also.
Client side (for a user in a browser)
Server side (in the background like Integrations, scripts, etc)
UI Policy - Mandatory, visibility, read-only
Data Policy - Mandatory, Read-only
Example :
CASE 1: A field made mandatory in incident using UI Policy.
Result :
Incident cannot be created by user in any browser without filling field
Incident can be created by integrations, APIs, scripts, flows, etc without filling the field.
CASE 2: A field made mandatory in incident using Data Policy.
Result :
Incident cannot be created by user in any browser without filling field
Incident cannot be created by integrations, APIs, scripts, flows, etc without filling the field.
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
