what is the difference data policy and UI policy

Bhavana Ramesh1
Tera Contributor

Hello,

What is the difference between data policy and ui policy?

regards,

Bhavna

1 ACCEPTED SOLUTION

AbhishekGardade
Giga Sage

Hello Bhavana,

Here are my observations about Data and UI Policy:

#Data Policy:

  1. Data policy is "server side"
  2. Data policies can apply rules to all data entered into the system.
  3. Data Policy Rules : mandatory and Read Only
  4. Converting Data Policy to UI Policy deactivates the data policy
  5. Alternatively you can use Use as UI Policy on client
  6. Apply to import sets - If selected, the data policy applies to data brought into the system from import sets. This option also applies to web service import sets.
  7. Apply to SOAP: If selected, the data policy applies to data brought into the system from a SOAP web service. Scripted SOAP web services are not affected. This field does not affect data policy interaction with REST web services.
  8. No option to run on onChange / onLoad

#UI POLICY: Governs form and form field behavior, client side

  1. UI Policy Actions: Read Only, Mandatory, Visible, Clear the field value
  2. UI Policy Related List Actions : hiding related list on form
  3. Run Scripts: UI Policies do not always require scripting.
  4. Global: If Global is selected the script applies to all views for the table. If the Global field is not selected you must specify the view
  5. Reverse if false: Take the opposite action when the Condition field evaluates to false. Execute if false script to run
  6. Order : The order of evaluation is from the lowest number to the highest number
  7. UI Policies execute after Client Scripts.
  8. Converting a UI policy to a data policy deactivates the UI policy. To retain the policy in the UI, ensure that the Use as UI Policy on client check box is selected on the data policy record.

Criteria

Client Script

UI Policy

Execute on form load

Yes

Yes

Execute on form save/submit/update

Yes

No

Execute on form field value change

Yes

Yes

Have access to field's old value

Yes

No

On Change on Multiple Field

No

Yes

Execute after Client Scripts

No

Yes

Set field attributes with no scripting

No

Yes

Require control over order of execution

*Yes

Yes

Apart from this, Mark gave you the links so you refer.

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

View solution in original post

7 REPLIES 7

Dubz
Mega Sage

UI policies apply in the client so when a user is interactive on the form. Data policies operate on the database so any requests to the database will have to conform to the data policy

Ruhi Jibhyenka1
Mega Guru

Hi Bhavana,

Basically the UI policy is client side and the Data policy is "server side".

If you want to test, make a read only UI policy on a field description and then try to modify this field on a "list view"

Then, do the same with the data policy.

So UI Policy is more useful if you want to display fields and data policy if you want to make mandatory or readonly fields (without ACLs) ==> You could have some exceptions sometimes

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy.

Thanks,

Ruhi.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Bhavana,

UI policy works on front end i.e. when user has interaction with the form. It runs on client side

Data policy is used to enforce some constraints on the fields whenever records inserted/updated from API or integration. They work at server side

you can convert UI policy to data policy via related link present under UI policy

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Mark Roethof
Tera Patron
Tera Patron

Hi there,

The Docs pages describe both pretty nice. Be sure to check it out:

https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/field-administrat...
https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/form-administrati...

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn