ServiceNow Script Include Interview Questions 2026
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.
These free questions are just the beginning.
The Job Switch Kit gives you 500+ battle-tested Q&A, a day-by-day prep roadmap, mock interview practice, and a complete career strategy — everything to walk in confident and walk out with an offer.
Battle-tested questions with structured answers — includes concept deep dives & scenario-based questions across every high-frequency topic
Day-by-day curriculum covering all 25 must-know topics in the right order
Full 45-min mock sessions with recording, transcript & instant feedback
Proven strategies for counter-offers, CTC decoding & in-hand salary strategy
Notice period tactics, BGV prep, resignation playbook & offer comparison
Per-topic dashboard, per-question confidence ratings, and topic completion progress — always know what to tackle next
Add private notes per question and per topic — only you see them. Star questions for your revision list and download as PDF
🔒 Secure payment via Razorpay · Instant access after payment
Your story could be the reason someone else lands their next ServiceNow role
If this content made a real difference in your prep, sharing that experience with your network helps other professionals discover it — and we'd love to say thank you with 10 days of premium access, completely on us.
Real Interview Questions & Answers
Questions shared by ServiceNow professionals and reviewed for clarity, relevance, and interview usefulness.
What is gs.include() in script include and how we can use it ?
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?
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.