ServiceNow Script Include Interview Questions 2025
What is Script Include?
Script Include contains set of variables and functions which are executed on server side. It is a reusable script logic which will only execute when called by other scripts such Business Rule, script actions, client script etc.
Script Include contains set of variables and functions which are executed on server side. It is a reusable script logic which will only execute when called by other scripts such Business Rule, script actions, client script etc.
What are the different type of Script Includes?
It is divided into below two types based on where it is being called/used :
a. Client callable Script Include: Here Client Callable checkbox is checked and it extends "AbstractAjaxProcessor" class
b. Server callable Script Include.
Based on it's structure, it can be divided into below 3 types :
1. On demand/classless Script Include: On demand Script Include in ServiceNow does not contain class (class less) and it only defines a
single function. We cannot use on demand Script Include on client side.
On demand Script Include can be defined as shown below:

On demand Script Include can be called in another server side scripts as mentioned below:
var demo=demoOnDemand();
2. Extend an existing class: extending of class is basically inheriting of class, means accessing the fields and methods of
another class.
We can extend another Script Include in an existing class as mentioned below:

c. Define a new class: Creating a new Script Include is basically creating a new class. When we define Script Include in
ServiceNow, then basic syntax gets auto populated as mentioned below:
It is divided into below two types based on where it is being called/used :
a. Client callable Script Include: Here Client Callable checkbox is checked and it extends "AbstractAjaxProcessor" class
b. Server callable Script Include.
Based on it's structure, it can be divided into below 3 types :
1. On demand/classless Script Include: On demand Script Include in ServiceNow does not contain class (class less) and it only defines a
single function. We cannot use on demand Script Include on client side.
On demand Script Include can be defined as shown below:

On demand Script Include can be called in another server side scripts as mentioned below:
var demo=demoOnDemand();
2. Extend an existing class: extending of class is basically inheriting of class, means accessing the fields and methods of
another class.
We can extend another Script Include in an existing class as mentioned below:

c. Define a new class: Creating a new Script Include is basically creating a new class. When we define Script Include in
ServiceNow, then basic syntax gets auto populated as mentioned below:
What are private functions in Script Include and how to declare function as private?
Private function in Script Include is a function which can only be accessible/called in same or extended Script Include, it cannot be called from BR, Client Script etc.
Private functions can be defined with prefix underscore as shown below :
Private function in Script Include is a function which can only be accessible/called in same or extended Script Include, it cannot be called from BR, Client Script etc.
Private functions can be defined with prefix underscore as shown below :
How to call Script Include from Server side script?
We can call Script Include in any server side script as shown below:
We can call Script Include in any server side script as shown below:
How to call Script Include from Client side?
It can be called from client side by using GlideAjax API.
To call Script Include at client side we have to make sure that client callable checkbox in Script Include is checked and Script Include class is extending class ‘AbstractAjaxProcessor’.
Example :
It can be called from client side by using GlideAjax API.
To call Script Include at client side we have to make sure that client callable checkbox in Script Include is checked and Script Include class is extending class ‘AbstractAjaxProcessor’.
Example :
How to call one function of Script Include to another function of same Script Include?
We can call internal function in the same Script Include as mentioned below:
this.functionName();
We can call internal function in the same Script Include as mentioned below:
this.functionName();
What is initialize() function in Script Include? And when it gets executed?
The initialize() function acts as constructor which can be used to set default values of variables.
This function automatically gets executed when we create object of Script Include class.
The initialize() function acts as constructor which can be used to set default values of variables.
This function automatically gets executed when we create object of Script Include class.
Prepared and confident for your interview?
Practice makes perfect! Test your skills with our virtual interview practice buddy and ensure you're fully ready for your upcoming interview.
User Added Interview Question and Answers
How to call Application based Script include into Scoped application?
Difference between client callable and server callable script include
Can we call a client callable script include on both server side and client side? if yes how will pass same parameter?
Can you call script include in onsubmit client script with help of glide ajax method
Is there any way to utilize client callable function in server side code?
can we use script include during onLoad client script?
The most complex client script and business rule you have worked on ?
How to call script include in background script?
🚀 Power Up Your ServiceNow Career
Join a growing community of smart ServiceNow professionals to stay ahead in interviews, sharpen your development skills, and accelerate your career.
Fuel My Passion
Loving the content? Well, of course you are. Here’s your chance to indirectly fuel the chaos that keeps this website running. Your contribution helps keep the wheels turning and allows me to continue pretending to be a responsible adult—while cranking out more content for you. Thanks for supporting my delusional dreams and helping me keep this website alive!
Buy Me a Coffee
Support with UPI
If you prefer making a UPI payment to support the website maintenance cost, scan the QR code below: