Ui policy vs Data policy??

ZebaT
Tera Contributor

Hi all,

Ui policies are for client side and Data policy for Server side I understand this.

I see option to convert ui policy to data policy, wanted to understand requirement or usecase for this.

Also data policy has check box to act as UI policy so I not able to understand then why UI policy will be required if data policy when checked as UI policy serves same purpose.

It's confusing can any one give practical usecase for all scenario and differentiate it. 

 

Thanks

6 ACCEPTED SOLUTIONS

Rafael Batistot
Kilo Patron

Hi @ZebaT 

 

This post might help you to understand 

 

https://www.servicenow.com/community/servicenow-ai-platform-articles/difference-between-data-policy-...

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.

View solution in original post

Nikhil Bajaj9
Tera Sage

Hi @ZebaT ,

 

Let me try to explain in a very simple language. 

 

UI Policy will work when data is entered through Form (Client side/Catalog/ Front end). For an example you made Phone numebr filed as mandatory from the form. It will make sure that phone number is not blank. But

It will not work when data is entering into the system by Import Sets(Transform Map) or integrations. User will be able to enter/upload blank phone numbers while importing data. If you want phine number field restriction to be applied on backend data ( Import set/ integration) as well then you should use data policy. Data policy will also make sure that blank phone numbers are not entering into the system.

So UI policy is stopping blank phone numbers from Form/catalog/ front end while Data policy is stopping blank phone numbers from backend data entry (Import set/integration). The purpose of both are same but the place they are working are different.

 

So when you have created a Data policy (to restrict any field value from backend) you can also check the checkbox to use it as UI policy to restrict the same field value from frontend. So in this way you are making sure that data will eb consistent does not matter entring from Front end or back end.

 

Hope it will clear the air.

 

 

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

ServiceNow Rising Star-2025

View solution in original post

adityahubli
Tera Guru

Hello @ZebaT ,

I have outlined some differences between UI Policy and Data Policy below.

 

 

UI Policy

  1. UI Policy is client-side and is used for configuration such as Read-only, Mandatory, and Visible fields.

  2. We can write scripts in UI Policies for additional modifications.

  3. UI Policies are applied only on UI forms.

  4. UI Policies do not apply to onCellEdit actions (List view editing).

  5. 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

  1. In Data Policy, there are only options for Read-only and Mandatory.

  2. Data Policies run on the server side, meaning they are enforced when data is inserted or updated in the database (table).

  3. There is no option to write scripts in Data Policies.

  4. Data Policies are applied even when data is inserted through Import Sets, Mobile UI, Web Services (API), or integrations.

  5. 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,

Technical Consultant

View solution in original post

Siddhesh Gawade
Mega Sage

@ZebaT ,

 

I will give you a short answer.

 

  • UI Policy: Applies only to the UI, it can show/hide fields, clear values, or make a field required in forms, but it does not enforce rules on the database/backend.

 

  • Data Policy: Enforces validation on the server/database level and prevents blank or invalid values from entering the system via imports or integrations.

 

  • Best practice: Use a Data Policy as the authoritative backend validation. If you want the same behavior in the UI, enable the Data Policy’s “use as UI policy” option (so you don’t have to recreate the UI rule). If validation is needed only in the front end, use a UI Policy alone.

 

Regards,
Siddhesh Gawade

View solution in original post

Utpal Dutta
Tera Guru

Hi @ZebaT ,

I hope you're doing well. I see that people have already provided you many links but I'll give you a simple use case on which I worked,

 

UI policy: Let's say you want to make "Assigned to" mandatory when "Assignment group" is changed. Now this will work fine when it's an interactive session meaning when a user is changing Assignment group on Incident form.

 

Data policies: Lets say above scenario is non interactive meaning Incident is getting created from an inbound integration. At this time if you have UI policy & Data policy then integration will fail & return error.

 

Now lets say you don't want to stop an integration from inserting record in incident table if "Assigned to" is not there because Assignment group manager can assign that incident later. So you will only create UI policy but not data policy.

 

I hope my answer helps, if it does then please mark it "Helpful" & "Accept the solution".

 

Thanks

View solution in original post

@ZebaT 

Thank you for marking my response as helpful.

As per new community feature you can mark multiple responses as correct.

💡 If my response helped, please mark it as correct as well so that this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

11 REPLIES 11

Rafael Batistot
Kilo Patron

Hi @ZebaT 

 

This post might help you to understand 

 

https://www.servicenow.com/community/servicenow-ai-platform-articles/difference-between-data-policy-...

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.

Nikhil Bajaj9
Tera Sage

Hi @ZebaT ,

 

Let me try to explain in a very simple language. 

 

UI Policy will work when data is entered through Form (Client side/Catalog/ Front end). For an example you made Phone numebr filed as mandatory from the form. It will make sure that phone number is not blank. But

It will not work when data is entering into the system by Import Sets(Transform Map) or integrations. User will be able to enter/upload blank phone numbers while importing data. If you want phine number field restriction to be applied on backend data ( Import set/ integration) as well then you should use data policy. Data policy will also make sure that blank phone numbers are not entering into the system.

So UI policy is stopping blank phone numbers from Form/catalog/ front end while Data policy is stopping blank phone numbers from backend data entry (Import set/integration). The purpose of both are same but the place they are working are different.

 

So when you have created a Data policy (to restrict any field value from backend) you can also check the checkbox to use it as UI policy to restrict the same field value from frontend. So in this way you are making sure that data will eb consistent does not matter entring from Front end or back end.

 

Hope it will clear the air.

 

 

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

ServiceNow Rising Star-2025

@ZebaT  , 

Well the answer is simple.

UI policies run on Client Side whereas Data policies run on Server Side.

UI policies have options to make the fields mandatory, readonly and visible whereas Data policies can only make the fields readonly and mandatory.

 

Data policies are mostly helpful when the bulk data is uploaded or your table is integrated with some other application. It checks all the conditions, for e.g if the data upload is happening with a mandatory field missing , it will restrict and throw an error through Data policy which UI policy can't.

 

UI policy will work on UI or only at the Form level.

 

Neverthless , both UI polices and Data Policies can be converted to each other.

 

If my response has helped you, kindly mark it as helpful and accept the solution.

 

Regards,

Nayan

 

Ankur Bawiskar
Tera Patron

@ZebaT 

UI policy always runs on client side

Data policy runs on server side

check these links

Difference between Data policy and UI policy 

What is the difference between UI policy and Data policy In ServiceNow? 

What is the difference between Ul Policy and Data Policy? 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader