0% found this document useful (0 votes)
2 views17 pages

All

The document provides a comprehensive overview of various ServiceNow concepts, including incident state transitions, GlideAjax syntax, and differences between P1 and Major Incidents. It also covers scripting examples, business rules, and REST API error handling, along with practical use cases for implementing security and workflow logic. Additionally, it highlights the importance of Scoped Applications and their deployment methods in ServiceNow.

Uploaded by

jitenofficial20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views17 pages

All

The document provides a comprehensive overview of various ServiceNow concepts, including incident state transitions, GlideAjax syntax, and differences between P1 and Major Incidents. It also covers scripting examples, business rules, and REST API error handling, along with practical use cases for implementing security and workflow logic. Additionally, it highlights the importance of Scoped Applications and their deployment methods in ServiceNow.

Uploaded by

jitenofficial20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PWC = Jade global = Globant = providence = nelson = UST Global = KPMG

1. What is the period duration to change Incident state from Resolved to Closed using a scheduled
job?

Answer:

In ServiceNow, when an incident is moved to Resolved state, it is automatically moved to Closed state
after a defined time period, which is usually:

7 days (default, but configurable as per business requirement)

How it works:

• A Scheduled Job runs periodically

• It checks incidents in Resolved state

• If the incident remains unchanged for a defined period, it is moved to Closed

Example Script:

var gr = new GlideRecord('incident');


[Link]('state', 6); // Resolved
[Link]();

while ([Link]()) {
if ([Link](gr.resolved_at) >= 7) {
[Link] = 7; // Closed
[Link]();
}
}

Key Point:

• Controlled by business logic or system property

• Commonly 7 days in real projects

2. What is the GlideAjax syntax?

Answer:

GlideAjax is used for client-server communication without refreshing the page.

Client Script:

var ga = new GlideAjax('MyScriptInclude');


[Link]('sysparm_name', 'getData');
[Link](function(response) {
alert(response);
});

Script Include:

var MyScriptInclude = [Link]();


[Link] = [Link](AbstractAjaxProcessor, {

getData: function() {
return "Hello from Server";
}

});

3. Why variable visible in Try It but not in Service Portal?

Answer:

Possible reasons:

• Variable not supported in portal widget

• Variable set not added in Service Portal catalog widget

• UI Policy or Client Script hiding it

• Variable is conditionally hidden

• Catalog item not properly configured for portal

Simple explanation:

Platform UI and Service Portal use different rendering engines, so visibility depends on portal
configuration.

4. How to get sys_id from client side?

Answer:

var sysId = g_form.getUniqueValue();

OR

var sysId = g_form.getValue('sys_id');

5. Difference between P1 Incident and Major Incident?


Answer:

P1 Incident Major Incident

Priority level based Business impact based

System classification Process-based classification

Single incident May include multiple incidents

Auto/manual assignment Always declared manually

Example:

• P1: Server down for one application

• Major Incident: Entire organization system outage

JADE GLOBAL

1. What is AbstractAjaxProcessor in Script Include?

Answer:

It is a base class used in Script Include to enable GlideAjax communication from client side.

Example:

var UserUtil = [Link]();


[Link] = [Link](AbstractAjaxProcessor, {

getUserName: function() {
return [Link]();
}

});

2. Use of callback function in OnCellEdit?

Answer:

It is used to control whether edited value should be saved or rejected.

Example:

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {

if (newValue == "High") {
alert("Not allowed");
callback(false); // reject update
} else {
callback(true); // accept update
}
}

3. Why AFTER Business Rule instead of BEFORE?

Requirement:

Child incidents completed → Parent should complete

Why NOT BEFORE:

• Before BR runs before database update

• Child state is not committed yet

Why AFTER:

• Child record already updated

• Safe to update parent

Example:

if ([Link] == 7) {

var parent = [Link]();


[Link] = 7;
[Link]();
}

4. Can we create email body in Scheduled Job?

Answer:

YES

Example:

var body = "Incident Report: " + [Link];


[Link]('[Link]', current, body, '');

5. Write logic to print users not part of any group

var user = new GlideRecord('sys_user');


[Link]();
while ([Link]()) {

var gm = new GlideRecord('sys_user_grmember');


[Link]('user', user.sys_id);
[Link]();

if (![Link]()) {
[Link]([Link]);
}
}

6. How to pass server data to client in widget?

Server Script:

[Link] = "Hello from Server";

Client/HTML:

{{[Link]}}

7. Convert [24,12,8,6] → [1,2,3,4]

Logic:

Divide each element by 6

var arr = [24,12,8,6];


var result = [];

for (var i = 0; i < [Link]; i++) {


[Link](arr[i] / 6);
}

[Link](result);

8. OnCellEdit parameters?

function onCellEdit(sysIDs, table, oldValues, newValue, callback)

Meaning:

• sysIDs → selected records

• table → table name

• oldValues → previous value


• newValue → new value

• callback → save control

GLOBANT

1. Workflow activities and uses?

Answer:

• Approval → approval process

• Notification → send email

• Run Script → execute logic

• Wait for Condition → pause workflow

• Create Task → generate task

• Join → combine parallel branches

2. Find biggest number

let array = [5, 6, 8, 15, 0];


[Link]([Link](...array));

3. Flow Designer actions?

• Create Record

• Update Record

• Send Notification

• Ask for Approval

• Wait for Condition

• Run Script

4. Types of Script Includes?

• Server callable Script Include

• Client callable Script Include

• Utility Script Include


• Extending Script Include (AbstractAjaxProcessor)

5. How parallel workflow works?

Multiple branches run simultaneously


Joined using JOIN activity

PROVIDENCE

1. How to print current date and time?

var gdt = new GlideDateTime();


[Link]([Link]());

2. How to get logged-in user (client side)?

g_user.userName;

NELSON

1. After vs Async Business Rule execution

• After BR → runs immediately after DB update

• Async BR → runs later in background queue

2. What is Synchronous?

Executes immediately and waits for completion

3. What is AJAXProcessor?

Used for client-server communication using GlideAjax

4. Who approves Demand?

Business stakeholder / Demand manager


5. Demand lifecycle?

Submit → Qualify → Approve → Convert to Project

6. Financial lifecycle?

Estimate → Budget → Allocation → Actual cost tracking

7. Dependent field creation?

Use:

• Dictionary dependent fields

• Reference qualifiers

8. Resource cost calculation?

Based on:

• Rate card

• Timesheet hours

• Cost model

9. Parallel catalog task completion?

Use:

• Wait for Condition

• Join activity

10. Sync vs Async JavaScript?

Sync Async

Blocking Non-blocking

Waits Runs in background


UST GLOBAL

2. How to change Incident view using Client Script for a particular role?

Answer:

We use onLoad Client Script + role check

Example:

Requirement:
Hide Priority and Assignment Group for HR users

function onLoad() {

if (g_user.hasRole('hr')) {

g_form.setDisplay('priority', false);
g_form.setDisplay('assignment_group', false);

g_form.addInfoMessage("HR users have limited view");


}
}

Key Points:

• g_user.hasRole() checks role

• g_form.setDisplay() hides fields

• Runs only in UI (not backend security)

3. What is Multi Row Variable Set (MRVS)?

Answer:

MRVS allows users to enter multiple rows of structured data in a catalog item.

Example:

Laptop request:
Software Name Version Type

Chrome 120 Free

Postman 10 Paid

Storage format:

Stored as JSON array

[
{"software":"Chrome","version":"120"},
{"software":"Postman","version":"10"}
]

Use case:

• Multiple software requests

• Multiple asset requests

• Bulk data input in catalog

4. What is Private Function in Script Include?

Answer:

Private functions are internal helper functions that cannot be accessed directly outside Script Include

Purpose:

• Hide internal logic

• Improve security

• Code reusability

• Avoid external misuse

Example:

var MyUtil = [Link]();


[Link] = {
initialize: function() {},

publicFunction: function() {
return this._calculateTax();
},

_calculateTax: function() {
return 18; // private logic
}
};

Key rule:

_underscore functions = private convention (not strict but standard)

5. What is Error Handler in REST API?

Answer:

Error handler is used to handle failures in API calls gracefully.

Example scenarios:

• API timeout

• Invalid request

• Authentication failure

• Server error

Example:

try {

var r = new sn_ws.RESTMessageV2();


[Link]("[Link]
[Link]();

} catch(ex) {
[Link]("API failed: " + [Link]);
}
Good practice:

• Log errors

• Return meaningful response

• Avoid system crash

6. What is 401 error in integration?

Answer:

401 = Unauthorized error

Meaning:

System is not authorized to access API.

Reasons:

• Wrong username/password

• Missing token

• Expired OAuth token

• Incorrect authentication type

Example:

API call without auth → returns 401

7. What is Tungsten Action in Workflow?

Real meaning (interview interpretation):

Tungsten = RPA integration (Robotic Process Automation)

Answer:

Tungsten action is used to:

• Integrate ServiceNow workflows with RPA bots


• Automate external system tasks

• Reduce manual work

Example:

• ServiceNow workflow triggers bot

• Bot logs into SAP and updates data

8. How to call UI Action in Server side and Client side?

Client Side:

g_form.submit('ui_action_name');

Server Side:

[Link](current);

Use:

• Client → triggers action

• Server → handles logic

9. What is gsftSubmit?

Answer:

Used to trigger UI Action from client script

Syntax:

gsftSubmit(null, g_form.getFormElement(), 'ui_action_name');

Example:

Button click triggers server UI action


10. Who approves Idea into Demand?

Answer:

Demand Manager / Portfolio Manager

Flow:

Idea → Review → Approval → Demand creation

11. What is APM?

Answer:

APM = Application Portfolio Management

Use:

• Manage enterprise applications

• Track cost, risk, lifecycle

• Optimize application usage

Example:

• Identify unused applications

• Reduce IT cost

12. What is Scoped Application?

Answer:

Scoped application is a separate isolated application in ServiceNow

Features:

• Secure namespace
• No conflict with other apps

• Independent deployment

13. What is version in Scoped Application?

Answer:

Version defines release iteration of app

Example:

• 1.0.0 → initial release

• 1.1.0 → enhancement

• 2.0.0 → major upgrade

14. How to move Scoped Application to another instance?

NOT via Update Set

Correct method:

Application Repository

Steps:

1. Create application in Studio

2. Package application

3. Publish to Application Repository

4. Install in target instance

15. How to publish Scoped Application?

Steps:

• Open Studio

• Click Publish
• Select version

• Submit to Application Repository

16. Authentication methods in REST API?

Answer:

• Basic Authentication

• OAuth 2.0 (most secure)

• JWT Token (external systems)

• API Key authentication

KPMG – USE CASE (DETAILED)

Use Case:

In Incident table, if Caller Department = HR, then only HR users should be allowed to move incident
from New → In Progress. Others should NOT be allowed.

Solution: Business Rule (Server Side Security)

Type:

Before Update Business Rule

Script:

if ([Link] == 2 && [Link] == 1) {

var callerDept = current.caller_id.[Link];

if (callerDept != "HR") {

[Link]("Only HR department users can move incident to In Progress");


[Link](true);
}
}

Explanation:

• Check state change (New → In Progress)

• Get caller department using dot walking

• If not HR → block update

Why Business Rule?

• Runs on server side

• Cannot be bypassed from UI

• Secure logic

FINAL INTERVIEW SUMMARY LINE

“I have strong hands-on experience in ServiceNow including Script Includes, Business Rules,
GlideAjax, ACL security, REST integrations, MRVS, UI Actions, Flow Designer, and ITSM modules like
Incident, Change, and Demand with strong understanding of client-server architecture.”

You might also like