• Call us: +91 9501707741
  • tutorialzdiary@gmail.com


ServiceNOW Training

ServiceNow Training Course
ServiceNOW Admin Training Course
ServiceNOW Development Training Course

ServiceNOW Hands on

ServiceNOW : How to get personal ServiceNOW instance to start exploring
ServiceNOW : List & Forms Administration
ServiceNOW : Reporting Module
ServiceNOW : Scheduling and Publishing Reports
ServiceNOW : Scripts & APIs
ServiceNOW : Workflows
ServiceNOW : Service Catalog Module
ServiceNOW : Incident Management
ServiceNOW : Change Management
ServiceNOW : Configuration Management
ServiceNOW: Business Rules & basic functions
ServiceNOW: Business Rule- Sample Scripts
ServiceNOW: Client Script-Sample Scripts
ServiceNOW : Knowledge Management
ServiceNOW: Client Script & basic functions
ServiceNOW : Changes in Incident,Change & Service Catalog Module in Helsinki(latest version of ServiceNOW)
ServiceNOW : Reference Qualifier

ServiceNOW Interview Questions and Answers

Part 1 : CMDB
Part 3: SLA
Part 4 : Scripts
Part 5: Table & Data Dictionary
Part 6: ACL
Part 7: Workflow
Part 8: Service Catalog

ServiceNOW: Client Script-Sample Scripts

Case 1: Removes the icon that matches the exact same name and text. 


fieldName – The field name..

fieldName – The icon to remove.

fieldName – The text title for the icon.




Case 2:Displays the field if true. Hides the field if false. This method cannot hide mandatory fields with no value.

Best Practice: Use UI Policy rather than this method whenever possible.


fieldName – specifies the field to be displayed or hidden.

boolean – true to display the field, false to hide the field.

Returns: void



Case 3: Removes a specific option from a choice list.

Note: (Versions prior to Eureka) When items are removed from a choice list by a Client Script, Google Chrome and Apple Safari will still display those items. When one of these web browsers is used, the “removed” items will be displayed as read only in the choice list and they cannot be chosen.


fieldName – specifies the field.

choiceValue – specifies the value stored in the database as a choice.

Returns: void

Example: Remove the ‘1’ Option from the Priority Field

remove option

Case 4 : Returns the elements for the form’s sections in an array.

Returns: array – the HTML Elements for the form.


form section

Case 5 : Displays an error message at the top of the form.

Parameters: message – the error message to be displayed.




Error Message

Error Message

Case 6 : Displays an informational message at the top of the form.

Parameters: message – the informational message to be displayed.




Info Message

Info Message

Case 7 : Highlight VIP caller whenever Caller is changed in Incident form.

Example :




The g_scracthpad object passes information from the server to the client, such as when the client requires information not available on the form. For example, if you have a client script that needs to access the field u_retrieve, and the field is not on the form, the data is not available to the client script. A typical solution to this situation is to place the field on the form and then always hide it with a client script or UI policy. While this solution may be faster to configure, it is slower to execute.

If you know what information the client needs from the server before the form is loaded, a display business rule can create g_scratchpad properties to hold this information. Theg_scratchpad is sent to the client when the form is requested, making it available to all client-side scripting methods. This is a very efficient means of sending information from the server to the client. However, you can only load data this way when the form is loaded. The business rule cannot be triggered dynamically. In those cases, use an asynchronous GlideAjax call.

For example, assume you open an incident and need to pass this information to the client:

  • The value of the system property css.base.color
  • Whether or not the current record has attachments
  • The name of the caller’s manager

A display business rule sends this information to the client using the following script:

g_scratchpad.css            = gs.getProperty('css.base.color');
g_scratchpad.hasAttachments = current.hasAttachments();
g_scratchpad.managerName    = current.caller_id.manager.getDisplayValue();

Leave a reply

Your email address will not be published. Required fields are marked *

Training Enquiry