what purpose we have client scripts?

Basha4
Tera Expert

i want to know client scripts in detail

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, client scripts are used to alter data and\or the visibility of data in the UI (browser).

If you want a better basic understanding of client script usage you should review the vendor documentation
https://docs.servicenow.com/
Register on the developer portal to spin up a free 'Personal Developer Instance' for testing\experimenting
https://developer.servicenow.com/
and then work through the free learning material available on the developer portal and other learning material available at https://nowlearning.service-now.com/

You can also browse\filter existing community forum questions and articles for those that contain client script related information.

Hitoshi Ozawa
Giga Sage
Giga Sage

Excerpt from ServiceNow documentation.

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

https://docs.servicenow.com/bundle/sandiego-application-development/page/script/client-scripts/conce...

Following page is a tutorial on creating Script Scripts.

https://developer.servicenow.com/dev.do#!/learn/learning-plans/sandiego/new_to_servicenow/app_store_...

Following video is an overview of client script

https://www.youtube.com/watch?v=AqUY98OToGY

https://www.youtube.com/watch?v=MCO2rheOcEc