- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 03:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 03:57 AM
Hi @harshshree7
Basic difference:
Feature | Client Script | Data Policy |
Execution Context | Client-side (browser) | Server-side (and optionally client-side) |
Use Case | UI behavior and interactivity | Data validation and integrity |
Applies To | Forms and Service Portal | Forms, APIs, and background processes |
Scripting Required | Yes | No (uses conditions and actions) |
For more info, please chcek out th below docs.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 03:48 AM
Hi @harshshree7
https://www.youtube.com/watch?v=OH8raGHojbU
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 03:54 AM - edited ‎06-16-2025 03:54 AM
Hi @harshshree7 ,
Aspect Details : Client Script
Runs on | Client side (browser) |
Purpose | Controls form behavior: hide/show, read-only, validation, auto-fill |
Used In | Forms (UI), Service Portal, Catalog |
Types | onLoad, onChange, onSubmit, onCellEdit |
Scope | Only affects the user interface — does not apply to data imported via scripts or integrations |
Example | Make a field read-only when the state is "Closed" on form load |
Aspect Details : Data Policy
Runs on | Server side, but can enforce rules on both UI and data API |
Purpose | Enforce data integrity by making fields mandatory or read-only |
Used In | Any record update: form, script, import set, integration |
Scope | Applies to data regardless of how it's entered (UI, API, imports) |
Example | Always require "Category" field on Incident, even during an import or Flow execution |
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Arun Manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 03:57 AM
Hi @harshshree7
Basic difference:
Feature | Client Script | Data Policy |
Execution Context | Client-side (browser) | Server-side (and optionally client-side) |
Use Case | UI behavior and interactivity | Data validation and integrity |
Applies To | Forms and Service Portal | Forms, APIs, and background processes |
Scripting Required | Yes | No (uses conditions and actions) |
For more info, please chcek out th below docs.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 04:12 AM
Hi @harshshree7,
Data Policies
Data policies enable you to enforce data consistency by setting mandatory and read-only states for fields.
Data policies are similar to UI policies, but UI policies only apply to data entered on a form through the standard browser. Data policies can apply rules to all data entered into the system, including data brought in through import sets or web services and data entered through the mobile UI.
For example, suppose that you are configuring a web service that allows users from outside the platform to update problems on the ServiceNow instance. Since these problems are not updated through the instance UI, they are not subject to the UI policies on the problem form. To ensure that the Close notes field is completed before a problem is marked Closed/Resolved, you can create a data policy that applies to server-side imports. Data that does not comply with this data policy produces an error. You can also apply the policy on the browser by selecting the Use as UI Policy on client check box in the data policy record.
Since UI policies can also manage the visibility of fields on a form, you may want to augment UI policies with data policies rather than replace them.
- Target records of SOAP web services
- Import sets
- Client-side UI policies
The admin role is required to edit data policies.
Client scripts allow the system to run JavaScript on the client (web browser) when client-based events occur, such as when a form loads, after form submission, or when a field changes value.
Use client scripts to configure forms, form fields, and field values while the user is using the form. Client scripts can:
- make fields hidden or visible
- make fields read only or writable
- make fields optional or mandatory based on the user's role
- set the value in one field based on the value in other fields
- modify the options in a choice list based on a user's role
- display messages based on a value in a field
Sources used: https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/script/client-scripts/concept/cli...
Regards,
Ehab Pilloor