ServiceNow Scripting Interview Questions 2026
What is the difference between Fix Script and Background Script?
1. We can check progress for Fix Script but not for Background Script.
2. We can kill running fix scripts in between but background script we cannot(Unless we go to Active Transactions via other session and kill it).
3. We can run Fix Script in background but Background script only runs in foreground.Foreground means the current session will be blocked until script execution gets completed, background process means you can keep on working on other stuffs while script runs in background.
4. Background script cannot be run for Scoped Application but Fix Script can be.
1. We can check progress for Fix Script but not for Background Script.
2. We can kill running fix scripts in between but background script we cannot(Unless we go to Active Transactions via other session and kill it).
3. We can run Fix Script in background but Background script only runs in foreground.Foreground means the current session will be blocked until script execution gets completed, background process means you can keep on working on other stuffs while script runs in background.
4. Background script cannot be run for Scoped Application but Fix Script can be.
What is the purpose of setWorkflow() method?
The purpose of setWorkflow method is to enable/disable the running of further business rules that may be triggered by current update.
The purpose of setWorkflow method is to enable/disable the running of further business rules that may be triggered by current update.
What is difference between initialise and newRecord method while inserting new record?
initialize(): Creates record with empty default field values.
newRecord(): creates a GlideRecord, set the default values for the fields and assign a unique id to the record.
Example :

Output :

initialize(): Creates record with empty default field values.
newRecord(): creates a GlideRecord, set the default values for the fields and assign a unique id to the record.
Example :
Output :
What is the use of get method in Glide record?
The ‘get’ method is used to return first record in the result set.
The ‘get’ method can also be used when you know the sys_id of that record. It returns Boolean values based on the result.
Example 1:
var grIncident=new GlideRecord('incident');
if(grIncident.get('9e7f9864532023004247ddeeff7b121f')){
gs.print('There exist incident with sys_id 9e7f9864532023004247ddeeff7b121f');
}else{
gs.print('There is no incident with sys_id 9e7f9864532023004247ddeeff7b121f');
}
Example 2:
var grIncident=new GlideRecord('incident');
if(grIncident.get('number','INC0000601')){
gs.print('There exist incident with number INC0000601');
}else{
gs.print('There is no incident with number INC0000601');
}
The ‘get’ method is used to return first record in the result set.
The ‘get’ method can also be used when you know the sys_id of that record. It returns Boolean values based on the result.
Example 1:
var grIncident=new GlideRecord('incident');
if(grIncident.get('9e7f9864532023004247ddeeff7b121f')){
gs.print('There exist incident with sys_id 9e7f9864532023004247ddeeff7b121f');
}else{
gs.print('There is no incident with sys_id 9e7f9864532023004247ddeeff7b121f');
}
Example 2:
var grIncident=new GlideRecord('incident');
if(grIncident.get('number','INC0000601')){
gs.print('There exist incident with number INC0000601');
}else{
gs.print('There is no incident with number INC0000601');
}
How can we update records without updating system fields like Updated, Created, etc. for a particular update?
The autoSysFields is used to disable the update of ‘sys’ fields (Updated, Created, etc.).
Example Script:
var gr = new GlideRecord('incident');
gr.addQuery('category', hardware);
gr.query();
while(gr.next()){
gr.autoSysFields(false);
gr.category = 'software';
gr.update();
}
The autoSysFields is used to disable the update of ‘sys’ fields (Updated, Created, etc.).
Example Script:
var gr = new GlideRecord('incident');
gr.addQuery('category', hardware);
gr.query();
while(gr.next()){
gr.autoSysFields(false);
gr.category = 'software';
gr.update();
}
What is the necessity of script action if we already have script include to write server side script?
Script Actions are executed asynchronously while Script Includes are executed synchronously.
If there is scenario where script execution is going to take longer time then it's always better to go with Script Actions as user don't need to wait for script execution completion.
Script Actions are executed asynchronously while Script Includes are executed synchronously.
If there is scenario where script execution is going to take longer time then it's always better to go with Script Actions as user don't need to wait for script execution completion.
How to stop form submission on Client and Server side?
On client side, we can use 'return false'.
On server side, we use the function 'current.setAbortAction(true)'.
On client side, we can use 'return false'.
On server side, we use the function 'current.setAbortAction(true)'.
What are the private function in script include and how to define them?
Function names starting with underscore are considered as private functions. These functions can be called only in same script include or extended/inherited script include.
Function names starting with underscore are considered as private functions. These functions can be called only in same script include or extended/inherited script include.
Assignment for you:
1. What is the difference between getXML(), getXMLAnswer() and getXMLWait() in GlideAjax? What are the drawbacks of using getXMLWait() function?
2. What is the best way to find difference between datetime on server side and client side?
3. How to copy attachments from one record to another?
1. What is the difference between getXML(), getXMLAnswer() and getXMLWait() in GlideAjax? What are the drawbacks of using getXMLWait() function?
2. What is the best way to find difference between datetime on server side and client side?
3. How to copy attachments from one record to another?
Most candidates who fail weren't underskilled.
They were underprepared.
These free questions cover the basics. But interviews go deeper. Discovery, ITOM, SecOps, Flow Designer, Now Assist, AI Agents. The Job Switch Kit gives you the full 15-day roadmap, 500+ structured Q&A across every module, a LinkedIn profile optimisation guide so recruiters find you before you even apply, and an interview bot that practices with you until you're ready. Most candidates walk in under-prepared. Don't be one of them.
Battle-tested questions with structured answers across every high-frequency topic — ITOM, SecOps Vulnerability Response, Discovery, Flow Designer, AI Agents, Generative AI, and Now Assist. Plus a dedicated Behavioral round covering HR questions, STAR method answers, salary negotiation, and career direction — because technical prep alone is not enough to get the offer
Day-by-day curriculum in the right order — scripting fundamentals, ITSM & CMDB, integrations, AI modules, and behavioral prep — so you peak exactly on interview day
Two modes: system-guided sessions with curated ServiceNow questions, and self-practice where you bring your own questions. Every session is recorded — download your Q&A transcript, review your answers, and pinpoint exactly where you need to improve
Proven strategies for counter-offers, CTC decoding & in-hand salary strategy
Notice period tactics, BGV prep, resignation playbook & offer comparison
Track completion per topic, rate your confidence per question, add private notes at question level and page level. Only you see them. Always know exactly what to tackle next
Step-by-step guide to rank in recruiter searches before you apply. Module-specific keyword lists, role-based headline and About section templates, experience bullet formulas, and certification display guidance built specifically for ServiceNow professionals
🔒 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.
Share real interview questions and help the ServiceNow community prepare better. All submissions are reviewed before publishing.
🚀 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.
No comments yet — be the first to share your thoughts!
Login to leave a comment or feedback. Your voice helps improve the content for everyone.