Job Switch Kit: Everything you need to crack your next ServiceNow interview Get Job Switch Kit →
Get the complete ServiceNow interview prep system — 500+ Q&A, mock interviews & more Get Job Switch Kit →

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.

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:



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 :


How to call Script Include from Server side script?

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 :


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();

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.

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.

500+ Expertly Curated Interview Q&A

Battle-tested questions with structured answers — includes concept deep dives & scenario-based questions across every high-frequency topic

15-Day Study Roadmap

Day-by-day curriculum covering all 25 must-know topics in the right order

Mock Interview Bot

Full 45-min mock sessions with recording, transcript & instant feedback

Salary Negotiation Playbook

Proven strategies for counter-offers, CTC decoding & in-hand salary strategy

Job Switch Strategy

Notice period tactics, BGV prep, resignation playbook & offer comparison

Visual Progress Tracker

Per-topic dashboard, per-question confidence ratings, and topic completion progress — always know what to tackle next

Private Notes & Revision Sheet

Add private notes per question and per topic — only you see them. Star questions for your revision list and download as PDF

Get Job Switch Kit →

🔒 Secure payment via Razorpay · Instant access after payment

10 days free — for your honest review

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.

Bushra 2026-01-13 04:52:04

What is gs.include() in script include and how we can use it ?


Mahesh 2026-02-24 04:51:08
The gs.include() method in ServiceNow is a legacy function used to load the code of one server-side Script Include into another server-side script, allowing you to access its functions and variables directly in the current scope. script inclued: function testAOP() { // function logic } testAOP.prototype = { sum: function() { var a = 10; var b = 20; var c = a b; return c; }, type: 'testAOP' }; calling script: gs.include('testAOP'); // Now you can call the function directly var total = sum();
0 Helpfuls
0 Helpfuls


samrat 2025-09-05 04:50:04

How to call Application based Script include into Scoped application?


Payal Pundir 2025-09-23 03:15:14
By using name as global.scriptIncludeName
1 Helpfuls
Tanmay 2025-12-17 01:31:02
We can call Application based Script include into Scoped application by using this : global.scriptIncludeName
0 Helpfuls
0 Helpfuls


Shweta 2025-05-09 03:31:06

Difference between client callable and server callable script include


Rama 2025-11-04 06:12:31
Whenever "Glide AJAX enabled" checkbox-enabled(checked) on Script Include form. It is called as Client Callable Script Include. Note: Enabling the "Glide AJAX enabled checkbox" doesn't restrict it from being called on server side. Whereas "Glide AJAX enabled"-disabled(unchecked) then it is server callable Script Include.
0 Helpfuls
0 Helpfuls


S 2025-04-07 00:54:11

Can we call a client callable script include on both server side and client side? if yes how will pass same parameter?


Tanmay 2025-12-17 01:33:49
Yes a Client-Callable Script Include can be used from both server side and client side.
0 Helpfuls
0 Helpfuls


Aparna Bhute 2025-01-06 03:23:28

Can you call script include in onsubmit client script with help of glide ajax method


Yashwanth 2025-01-30 23:09:41
You can, but it consists of an async function, so you can't prevent the form submission based on that async function. It's functioning is unpredictable; sometimes it completes its execution before form submission, but sometimes it doesn't. So it's better to use it onLoad.
0 Helpfuls
0 Helpfuls


A 2024-09-24 08:56:17

Is there any way to utilize client callable function in server side code?


Ajay 2025-05-24 06:57:04
No,we can't use because it is only designed to call on Client Side.
0 Helpfuls
0 Helpfuls


ajit kondekar 2024-04-17 05:06:36

can we use script include during onLoad client script?


Jim 2024-05-04 04:59:42
Yes, you can call script include in onLoad client script by using GlideAjax.
0 Helpfuls
0 Helpfuls


Atharva 2024-01-10 04:28:49

How to call script include in background script?


Namrata 2024-01-10 07:17:43
You can use below script : var scriptInludeVariable=new ScriptIncludeName(); //Replace ScriptIncludeName with your script include name scriptInludeVariable.functionName();//functionName-> One of the function name from your script include
0 Helpfuls
Gvk 2025-08-05 04:25:58
new ScriptIncludeName().functionName();
0 Helpfuls
0 Helpfuls








🚀 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.

Comments




📝 My Topic Notes 🔒 Only visible to you
Log in or sign up free to save notes