0% found this document useful (0 votes)
13 views108 pages

Understanding ServiceNow Business Rules

The document provides an overview of various types of business rules in ServiceNow, including Global, Display, Async, Query, After, and Before Business Rules, detailing their functions and creation steps. It also discusses related concepts such as server-side field validation, g_scratchpad, ACLs, and SLAs, explaining how they are implemented and their purposes. Additionally, it covers widget communication and embedding in ServiceNow, emphasizing the importance of these features for effective system performance and user interaction.

Uploaded by

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

Understanding ServiceNow Business Rules

The document provides an overview of various types of business rules in ServiceNow, including Global, Display, Async, Query, After, and Before Business Rules, detailing their functions and creation steps. It also discusses related concepts such as server-side field validation, g_scratchpad, ACLs, and SLAs, explaining how they are implemented and their purposes. Additionally, it covers widget communication and embedding in ServiceNow, emphasizing the importance of these features for effective system performance and user interaction.

Uploaded by

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

1) What is Global Business?

(Fujitsu First Round)


Global Business Rule is a business rule that will run every time a page loads in
the system. The selected table for this is global and hence there are no
restrictions or table conditions.
Using global business, will impact the system performance as it runs every time.
Instead of global business rule, we can use script include as it will run only when
invoked.

Steps to create Global Business Rule:


1) Create a new business rule in Global Scope and select the table as global.
2) Click on Advanced and Remove Everything and code any function.

3) Save the BR.

4) Create another BR with some conditions and use the created function
directly.
5) You will see that it runs every time.

2) Why we still have Global Business Rule if there is script


include feature present? (Fujitsu First Round)
I believe that Global BR is still available only for backward compatibility and in past it was also used
as globally accessible function.
According to ServiceNow, global business rules can load on every page of a
system, but there is no benefit to loading scripts on every page. Instead, you can
move the function definition to a Script Include, and the name of the Script
Include must match the name of the function

3) What is Display Business Rule? (Fujitsu First Round)


Display Business Rule runs before the form is displayed or presented to the user,
just after the data is fetched from the database.
It can be used to pre-populate some fields like category, short description and
etc, before the form is displayed to the user.

To create a Display Business Rule: -


a. Create a new Business Rule and Select and Table.
b. In When to Run Section, select when to Display and select filter conditions
if required.
c. You can choose to write script from advanced section by clicking on
advanced checkbox or directly population field from the action section.

d. Save the Business Rule


e. Try a new record and you will see the fields are pre populated.
4) What is Async Business Rule? (Fujitsu First Round)
Asynchronous Business Rules (ABRs) run after database commits in the
background, simultaneously with other processes. This allows ServiceNow to
return control to the user sooner, but may take longer to update related
objects. ABRs are like After Business rules. The only difference is that After
business rules return a response to the client and might take time due to the
ongoing transaction, whereas ABRs run in the background. This means that when
the form reloads, the results of any After business rules will be shown, but not
the results of ABRs as it run in the background.

To Create an Async Business Rule, follow these steps:


a) Create a new Business rule on Any Table and check the Advanced
checkbox to bring the when section

b) Select Async from the When Dropdown and check Insert or Update or any
checkbox to select the action timing.

c) Navigate to Script section and write a glide record


d) Create a new incident. You will see that it never sleeps for 10 seconds
because of the async BR, the transaction is processing in the background.

5) What is Query Business Rule? (Fujitsu First Round)


Query Business Rule runs on any query operation. So, whenever we open
any record or change something or just navigate to list view, ServiceNow
is querying the database behind the scene. So, query is the first thing
performed whenever we try to do something on a table.
Example: If you open incident list view, then ServiceNow is querying
behind the scene to fetch all the incident records and display it in list view.

To create a query business rule, follow these steps;

1) Create a new Business Rule in the same scope as the table you are
going to select and click on the advanced tab.
2) In when to run section, select when and check the query
checkbox.

3) In the advanced section, add an info message.

4) Save the record and navigate to the list view of the Incident, you will
see the info message there.
5) Try to make any change in the list view and see that the BR runs on
every change.

An industry use case of Query BR can be to show only active users to non-
admins

1) Change the table in the Query BR to user.

2) Navigate to Advanced section and add condition and modify the


script.
3) Save the form and impersonate a non admin user and check the
user table.
4) You will notice that you can only fetch active users there.

5) Now, end impersonation and check with admin user and see the
difference.
6) What is After Business Rule? (Fujitsu First Round)
After Business Rule runs after the data is inserted to database. It is like Async BR.
The only difference is Async BR runs in the background and gives the control
back to the user, meanwhile the control will not be transferred back to user until
the After BR has executed successfully.

To Create an After Business Rule, follow these steps:


a) Create a new Business rule on Any Table and check the Advanced
checkbox to bring the when section

b) Select After from the When Dropdown and check Insert or Update or any
checkbox to select the action timing. Also populate any filter condition if
you want
c) Navigate to Script section and write a gliderecord

d) Create a new incident. You will see that it will sleep for 10 seconds before
displaying the business rule as after rule will not control back until the
transaction is complete.

7) What is Before Business Rule? (Fujitsu First Round)


Before Business Rule runs before the data is inserted or updated into database. It
can be used to create a validation on Server-Side end like validating if user has
sufficient balance in the account before making transaction.

To create a before business rule, follow the below steps:


a. Create a new Business rule on Any Table and check the Advanced
checkbox to bring the when section

b. Select Before from The When Dropdown and check Insert or Update
or any checkbox to select the action timing.

c. Add any script in the advanced section

d. Save the rule and try to update an insert record and you will see the
info message.
4) Difference between Display, Before and After Business Rule
(Fujitsu First Round)

Aspect Before Business Rule After Business Rule Display Business Rule
Executed before a Executed after a certain Relates to how information is
Definition certain event or action. event or action. displayed.
Typically enforced
Implementati through constraints or Enforced at the application
on validation logic. Implemented using triggers. layer.
Validates data or Enforces additional
conditions before constraints or triggers actions Governs data presentation to
Purpose processing further. post-event. users.
Check if account has
sufficient funds before Update inventory levels after Display data in light or dark
Example withdrawal. a purchase transaction. mode.

4) In what order will Before, After, Async and Display Business


Rule Run? (ServiceNow First Round)
First Display Business Rule will run when the form loads. Next, Before
Business Rule will run, before inserting data into the Database, Next After
Business Rule Will run after inserting the data into Database and then Async
Business Rule will run if there is any background transaction.
Display->Before->After->Async
5) Create a widget that will take an input as text and show an
alert with the input value entered on button click.
(Cognizant First Round)

HTML:

Client Script:
6) How to create a related list and add it on a form? (Fujitsu
First Round)
Before creating a related list, lets understand what is a related list.
As the name suggest, related list is a list that holds data from a table that
is related to the current table.

Example: A case form can have Knowledge Articles or HR Task Related list,
meanwhile an incident form can have problem or priority Related List.
Steps to create a related List:
a) Navigate to System Definition -> Relationships and create a new
record.
b) Fill in the fields like Applies to Table means in which table you want
to show it
c) Queries from table means from which table you want the related
data to be shown.
d) Query with section can handle any additional filter queries
e) Save the form
f) Navigate to the record, where you want to see the related list
g) From the hamburger icon, navigate to Configure -> Related List and
pick and arrange the related list you have created and save the
slushbucket.

h) Check If the related list is visible.


7) How to hide UI Actions from a Related List?
A Related list can have some UI actions like Add or New. To hide a New UI
Action from a related list, follow these steps:
a) Right click on any column of the related list
b) Go to Configure -> List Control
c) Check the Omit new button and save the form

d) Check if the New UI Action is still visible,

8) How to make a server-side field mandatory? (Fujitsu First


Round)
It is not directly possible to make a field mandatory on server side in
Servicenow. However, one can write some validation using before
business rule to check if the value is not blank of the field.

Script for doing this is given below:

Other resources like Data Policies can be used to make a field mandatory on the
server side.
For example, Let’s say if user id on user table is made mandatory using Data
Policy. If an integration is trying to create a record without populating the user id
field, the update will fail.

9) What is g_scratchpad?
g_scratchpad is an object that is used to pass data that is not available on
the form from server side to client side. It is recommended that it is only
used with Display Business Rule or Workflows.
If we know that what information the client needs from the server before
the form loads, then in that case, one can use a display business rule with
g_scratchpad object to hold the data.

Steps for implementing it:


1) Create a display business rule and add the following script
2) Write the following script to check if incident has attachment.

3) Create a client script that will check on submit that If attachments


are present on the case.
4) Check an already created incident and try to re-submit something
and check the alert message there

4) Difference between [Link]() and [Link]() (Fujitsu


First Round)
[Link]() and [Link](), both methods are used in Service
Portal to query the server. Most of the functionality of these method is
same but there is a major difference in both the functions
a) [Link]() method is used to fetch data from server side. It can
fetch data without reloading the form. [Link] method should only be
used to fetch data from server. As best practice, it should only be used to
fetch data like list of records.
For example, you might use it to retrieve user preferences, fetch a list of
records, or get configuration settings.
b) [Link]() method is used to update data to server side. It can
also be used to fetch data from server side but as best practice, it should
only be used to update data on server side like update short description of
a case.
For example, you might use it to save changes made by a user in a form,
update the state of a record, or trigger a workflow based on user
interactions.

Another Major difference is that [Link]() accepts a dispatch payload


to be sent to server and returning response or error accordingly
Whereas the [Link]() methods just pass the values directly using
[Link].variable_name = ‘value’ to the server.

Refer to Question No:44 for more reference.


5) An example where you have used [Link]() (Fujitsu First
Round)
Created a widget that will fetch total count from a particular table on a
click of a button.

HTML:
CSS:
Client Script:
Server Script:
6) What will happen if we check the public checkbox on any
widget or portal page?
If we check the public checkbox on any widget or portal, then that widget or
page will be visible to any user without logging into the instance.
For example: i have widget which has list of html fields and i have added on
form. so if user will hit on the portal URL without logging then he can see those
html fields because the widget we have checked as publi c

4) Widget to Widget Communication (Cognizant Technical


Round)
Widget can communicate with other widget on the same page or the widgets
that are embedded into a widget i.e Child and Parent Widgets.
$emit and $broadcast are two functions that are use to pass data from child to
parent or parent to child widget.

$emit – Emit Function is used to pass data from Child Widget To Parent Widget
$broadcast – Broadcast function is used to pass data from parent widget to child
widget or to pass data from one widget to another widget on same page.
Using Emit From Child Widget

Accepting Data From Child Using On Function In Parent Widget

4) Embedded Widgets (Cognizant Second Round)


Embedding widgets can be done in 3 ways in Service Now

1) HTML
1a) Adding Options in the HTML

2) Client Script
2a) Passing Options to Client Scripts

Embedding a widget helps in maintaini

3) Server Script
5) ACLs (Fujitsu First Round)
ACLs also known as Access Control list are used to provide access controls access to data
by defining permissions for specific tables and fields. It specifies who can read, write,
create, or delete data based on roles, conditions, and scripts. ACLs ensure that only
authorized users can perform certain actions on records and fields.

To Use ACLs, one first has to elevate his role to Security Admin
To Create an ACL:

1) Navigate to System Security > Access Control(ACL)


Or Navigate to any COE and click on Configure -> Security Rules

There are 3 levels of ACLs and the evaluation order mentioned below

- Field Level ACLs – Evaluated first; applies to specific fields.


- Wildcard or * Level ACLs - Evaluated second; applies to all fields in a
table if no specific field-level ACL exists.
- Table Level ACLs or None -Evaluated last; applies to the entire record in
the table.

Tricks ->
1) If a Field Level ACL is restricting an access to a field , then, even * ACL cannot
provide access to the field
2) If there is a Field level ACL providing access and a table level ACL restricting
access, user will still see the table and fields, but the data will be blank in those
fields.

6) SLAs
SLA also known as Service Level Agreement, is basically a set of
agreements between a service provider and customer that define the
scope, quality and speed of the services being provided.
In short, SLAs are kind of deadline, in which a particular task should be
completed.
To Create a SLA, follow the following steps
a) Navigate to Service Level Management -> SLA -> SLA
Definitions
b) Click on New and fill all the following fields

c) Add the required conditions like what will be the Start conditions
of SLA, What will be the Pause Condition of SLA, what will be the
Stop conditions of SLA and what will be the Reset conditions of
SLA
Start conditions:
Pause Condition:

Stop conditions:

Reset conditions:

d) Save the form and your SLA should trigger on the start conditions
defined
7) Explain Response SLA?
The Response SLA is when the target field is selected as Response. It is
designed to ensure that a support team acknowledges or acts on an
incident or request within a specified time.
Think of a Response SLA as a timer that helps ensure that support teams
quickly acknowledge or start working on a problem. Here’s a simple way
to understand it:

What a Response SLA Does:

1. Start of the Timer:


- Imagine you have an incident, like a reported problem with the email
system.
- When this incident is created and meets certain conditions (e.g., its
state is "New" and its description is "The entire corporate email system is
down"), the Response SLA timer starts.

2. During the Timer:


- The timer keeps running, and the goal is to see if the support team
acknowledges the incident within a set amount of time, like 15 minutes.

3. Stopping the Timer:


- The timer will stop or pause when the support team takes the first
action to address the incident. This could be:
- Changing the state of the incident to "In Progress."
- Adding a note saying they are working on it.

4. Breaching:
- If the support team doesn’t acknowledge or start working on the
incident within the 15-minute window, the SLA will breach. This means the
service standard was not met.

8) Explain Resolution SLA


A Resolution SLA is similar to a Response SLA, but instead of focusing on
how quickly a support team acknowledges an issue, it focuses on how
quickly the issue is fully resolved. Here’s a simple breakdown:
The Resolution SLA timer starts when the incident or request meets
certain conditions. For example, it could start when the incident’s state
changes to "In Progress" or when it’s first logged.
The timer counts down to track how long it takes to completely resolve
the issue.
The timer stops when the issue is resolved. This means that the support
team has completed all necessary actions and the incident is marked as
"Resolved" or "Closed."
If the issue is not resolved within the set time frame (e.g., 1 hour), the
SLA will breach. This means the service standard was not met for
resolving the issue.

9) Difference between Resolution and Response SLA

The difference between Resolution and Response SLA are as follows:

Aspect Response SLA Resolution SLA


Ensures that the support team
acknowledges or starts working on the issue Ensures that the issue is fully resolved
Purpose within a specified time. within a specified time.
Starts when the incident/request meets
Starts when the incident/request meets certain conditions (e.g., state changes to
Timer Start certain conditions (e.g., state is "New"). "In Progress").

Stops or pauses when the first meaningful Stops when the issue is resolved (e.g.,
action is taken (e.g., state changes to "In incident is marked as "Resolved" or
Timer Stops Progress" or a work note is added). "Closed").
The speed of acknowledging or starting work The speed of resolving the incident or
Primary Focus on the incident. fulfilling the request.
Critical for ensuring timely acknowledgment Critical for ensuring timely resolution of
Common Use Case of urgent issues. issues and service requests.
Completing all required tasks and
Typical Actions Adding a work note, changing the state to changing the state to "Resolved" or
Tracked "In Progress." "Closed."
Occurs if the acknowledgment or action is Occurs if the issue is not fully resolved
Breaching not taken within the specified time. within the specified time.
Measurement "Acknowledge an incident within 15 minutes "Resolve an incident within 2 hours of it
Example of being logged." being logged."

10) Difference between Business time left and Business


elapsed time in SLA
Metric Business Time Left Business Elapsed Time
Time remaining before SLA Time that has passed since SLA
Definition breach. started.
To track the amount of time
To determine how much time is used toward meeting the SLA
Purpose left to meet the SLA target. target.
Helps in planning and ensuring Helps in tracking progress and
Usage timely action. remaining time.
Total SLA duration - Elapsed Time elapsed from SLA start to
Calculation Business Time. current time.

11) Retroactive start in SLA


Retroactive Start in an SLA allows the timer to start from an earlier time, like
when the task (e.g., an incident) was created, rather than when the SLA was
applied. This helps capture all the time that has passed since the task was first
logged, ensuring more accurate tracking.

Simple Example:
 Task created: 10 AM
 SLA applied: 12 PM
 With Retroactive Start: SLA timer starts from 10 AM, not 12 PM,
counting the time from when the task was created.
12) Difference between Retroactive start and Reset
condition in SLA
Retroactive Start:
 Purpose: Starts the SLA timer from a past time (e.g., when the task
was created) instead of when the SLA was applied.
 Use Case: To account for time that has already passed before the
SLA was attached.
Reset Condition:
 Purpose: Restarts the SLA timer if certain conditions are met (e.g., if
an incident's state changes).
 Use Case: To restart the SLA when key changes occur in the task
(e.g., reassignment or reopening).

13) Data Policies


14) Transform Maps
10) Workflows and Flow Designer (Cognizant First Round)
15) Why to use Scripted Rest APIs? (Cognizant First Round)

Scripted Rest APIs are used to create custom web services APIs endpoints
that can be used by other system to fetch data from ServiceNow Instance.
Scripted Rest Apis follows REST structure and one can customize them to
use different conventions.
One can define service endpoints, query parameters and headers for
scripted Rest APIs

An example of Scripted Rest API to fetch HR Case for Incoming Email ID.
The Active Flag is optional.
API Call:
Response From ServiceNow:

16) MID Server


in ServiceNow, A MID Server (Management, Instrumentation and
Discovery Server) is a software that facilitates communication between
the ServiceNow instance and external system or networks. It acts as a
bridge for data flow, enabling ServiceNow to interact with systems behind
firewalls or within private networks.

In short: A Mid Server in ServiceNow, is a tool that acts like a messenger


between your company’s internal systems (like servers or databases) and
your ServiceNow instance. It sits inside your network and safely sends
data back and forth without exposing your internal system to the internet.
11) Why to use Mid Server

Mid server provides an additional layer of security. Following can be


considered the reason to use Mid Server

1. Discovery: The MID Server is crucial for Discovery processes,


where it collects data from devices, servers, and applications in your
network and reports it back to ServiceNow.
2. Integrations: It enables integration with third-party systems by
securely handling REST, SOAP, JDBC, and other types of connections
that ServiceNow needs to interact with external services.
3. Orchestration: The MID Server allows ServiceNow to execute
automation tasks, like running scripts or managing services directly
on remote systems.
4. Security: It operates within your organization's network, ensuring
data is transferred securely without exposing internal systems to the
internet.
In summary, the MID Server is a key tool for securely extending
ServiceNow’s capabilities beyond its cloud environment, enabling
communication with systems and data that reside in local networks.

12) Rest Messages (Cognizant First Round)

REST messages are used to send HTTP requests to remote systems. This
allows you to integrate ServiceNow with other applications or services by
consuming their APIs. REST messages can be configured to use different
HTTP methods like GET, POST, PUT, DELETE, etc., and can also handle
authentication methods such as Basic Auth, OAuth, API keys, etc.
17) Order Guide and Catalog Items
18) Domain Separation? (Fujitsu First Round)
In ServiceNow, Domain Separation is a method that allows multiple
tenants or business entities to operate within the same instance, keeping
their data, processes and configurations separated.
It is useful for organization that need to enforce data isolation across
distinct business units or customer accounts while sharing the same
ServiceNow instance
When to use Domain Separation:
a) Maintain Global process and Global Reporting (MSP)
b) When you have separated business entities/ sub-organization
c) When business units need individual process
When not to use Domain Separation:
a) Data Sharing is Needed: If departments need to frequently share
data and collaborate across entities, domain separation can create
unnecessary barriers.
b) Low Complexity Environment: For smaller organizations or
simple use cases, domain separation may add complexity without
enough benefit.
c) Frequent Cross-Domain Processes: If workflows span multiple
entities, domain separation can complicate process management
and increase maintenance effort.

19) Custom Applications (Fujitsu First Round)


20) What is [Link]() and why should we avoid it?
21) What is [Link]() method used for in Script
include? (Cognizant First Round)

In ServiceNow, [Link]() is a part of the ServiceNow JavaScript framework


(GlideScript) and is primarily used to create custom classes and objects in
Script Includes. It provides a mechanism for building reusable, structured code
by defining classes, which are essential for organizing large scripts and
functionalities in a modular way.
Let’s break this down in more detail:
1. Where is [Link]() Defined?
[Link]() is part of the ServiceNow platform's core API. It is not standard
JavaScript but is specific to ServiceNow’s server-side scripting environment. This
method is provided by ServiceNow's GlideScript framework, which extends
JavaScript to support object-oriented programming on the platform.
This method helps define a class, mimicking object-oriented behavior found in
other programming languages like Java or Python. The class created with
[Link]() has an associated prototype, which allows you to define methods
and properties that are shared across instances.
2. Why is [Link]() Used?
The purpose of [Link]() is to create structured, reusable code by
encapsulating related logic and data within a "class." This is especially useful in
Script Includes, where you want to write server-side code that is clean,
maintainable, and can be easily instantiated or reused in other scripts.
Using classes provides several benefits:
 Code Reusability: You can define reusable methods and logic within a
class, which can be instantiated and reused across different parts of the
application.
 Encapsulation: You can bundle related functionality and data together,
making the code more modular.
 Maintainability: Changes can be made to the class in a single place, and
all instances will automatically reflect those changes.
 OOP Structure: By using [Link](), you can structure your code in
an object-oriented programming (OOP) way, which is beneficial when
dealing with complex integrations, business logic, or reusable utility
functions.

22) What is initialize:function(){} Is used for in Script


Include?
The initialize function can be used to initialize global variables in the script
include.
These global variables will be accessible across the script include and any
method or function can use these variables directly.
Calling and Output:
23) What is Data Policy?
Data policies are same as of UI policy in functionality. They also provide a
mechanism to make a field mandatory or read only. However, where UI
Policy works on the client side, data policies work on the server side.
Another difference is that the UI Policy can make field hidden while in Data
Policy that feature is not present.
Data policies ensure that the value of a field is populated (if the field is
mandatory) during any import or transform or any integration.

Let’s consider this scenario:


There is a table Laptop Issues and the field Mobile Number is marked
mandatory using Data Policy
1) When you try to import an excel with some data and mobile number is
not populated in that excel, then the upload will fail.

2) Now, lets assume that the data is being populated from Integration via
flow designer and the mobile number is not populated there as well, then
the flow will crash and the record will not be created.
24) Integration between two ServiceNow instance HR
Profile.
25) Difference between Opened for and Subject Person
The subject person field refers to any user who is affected by any request
or incident whereas the Opened For field refers to any user on whose
behalf a case or request was created.
26) Given a dynamic payload, fetch a particular email
(sand@[Link]) and get the user’s name and employee
number from that email. (Cognizant First Round)
27) Add a related list on HR Case Table to all incidents that
are created for that HR Case. (Fujitsu First Round)

1) Navigate to System Definition -> Relationships


2) Create a new Record with name “Incident For Case Record”
3) Applies to Table will be HR Case
4) Queries from table will be Incident
5) Add a script to fetch incidents related to HR Case.
6) Navigate to any HR Case record and click on hamburger icon and
select configure-> related list
7) Select the Relationship just created from the slush bucket and
arrange accordingly on the related list tabs
8) Save the form and you will see the new related list on the case.

(Cognizant Technical Round Questions [22 –


32])

28) In Transform Script, what is the difference between the


OnAfter and
onComplete function difference
29) Create a flow that will send notification to assigned to
when the case is not updated for last 5 days
Follows these steps:
a) First Create a new Flow with Daily Trigger. Select Any time.
b) Modify a look up records action to get all the cases that were
updated 5 days ago.

c) Check if such records exist

d) Add a loop to go send email for each case.

e) Set To, Subject and Body of the email


f) Remember, the receiving (To) will be assigned to of the case and the
subject should contain the case number

30) How can we add two values from source field into one
field in target table. The target field is a string field.
Given that the target field is a string field, one can concatenate the values
from 2 field and merge into a single field. If required one can separate the
two values with some symbol to be more precise.

31) On an inbound integration, when will the business rule,


on insert or on update
It depends whether you are updating a record or inserting a new record
using inbound integration. So, in an inbound integration, ServiceNow is
accepting the third-party system data and manipulating its record. When
manipulating the data, we will see the business rule will on the specified
trigger.

32) Given that we must write an onload and onchange


script, can we write both these script in one place to avoid 2
scripts?
Yes, we can write an onload script within and onchange script. This can
reduce our effort and we do not have to write another new script for
onload.

Here is how it will work:


1) Create a new client script
2) Select Table Name. (Total rewards table in this example)
3) Select a UI Type (All in this example)
4) Select Type as On Change Script
5) Select a field that’s modification will trigger the onchange script
(State field in this example)

6) Write the below code.


7) Load an HR Case and see the first alert to run as the form loads.

8) Change the state field and see the onchange script running.

33) GlideAggregate
34) Use GlideAggregate to create a HR Task if 5 HR Cases
are created for a subject person. Assign the task to the
subject person.
35) Without GlideAggregrate, create a HR Task if 5 HR
Cases are created for that subject person. Assign the task to
the subject person.
36) Update a record without changing the updated date or
updated by
autoSysFields method available in the gliderecord object can help with the above
scenario.
This will update the target record without updating the auto System fields like Created or
Updated or Created by or Updated By

37) In ServiceNow how can I check or track what data I


have sent to third party?
In ServiceNow, tracking and verifying the data sent to third parties requires a
combination of configuration, monitoring, and auditing. Here's how you can
check what data has been sent to third parties in ServiceNow:

1. **IntegrationHub and API Logs:**


- ServiceNow's IntegrationHub maintains logs of integration activities, including
API requests and responses.
- You can review the IntegrationHub logs to see details of data payloads sent to
third-party systems through integrations.
- Navigate to ` syslog_transaction_list.do` to view transaction logs, or check
`System Logs` under `System Logs > All` for API-related activities.

2. **Data Export and Import Logs:**


- ServiceNow tracks data exports and imports through its data import/export
logs.
- You can access these logs by navigating to `System Import Sets > Data
Sources` or `System Import Sets > History`.
- Review the logs to identify any data exports or transfers to third-party
systems.

3. **Audit Trails and Change History:**


- ServiceNow maintains an audit trail of data changes, which can help you
track data sent to third parties.
- Navigate to individual records (e.g., incident records, task records, etc.) and
check the `Audit` or `History` related links to view the change history.
- Look for changes indicating data sent to external systems or third parties.

4. **Scheduled Data Exports and Reports:**


- If you have scheduled data exports or reports that are sent to third parties,
you can review these configurations.
- Navigate to `System Scheduler > Scheduled Jobs` to view scheduled data
exports or reports.
- Review the configurations to identify what data is being exported and where it
is being sent.

5. **Custom Applications and Workflows:**


- If you have custom applications or workflows that involve sending data to
third parties, you can check these configurations.
- Review the workflows, business rules, and scripts associated with the custom
applications to identify data transfers to third parties.
- Check any logging or auditing mechanisms implemented within the custom
applications to track data sent to third parties.

6. **Third-Party Integration Documentation:**


- Refer to the documentation or configuration details of each third-party
integration within ServiceNow.
- Review the integration settings, mappings, and transformations to understand
what data is being sent to third parties.
- Ensure that data sharing agreements and compliance requirements are
documented and accessible for reference.

By following these steps and leveraging ServiceNow's logging, auditing, and


monitoring capabilities, you can check and verify what data has been sent to
third parties. It's important to regularly review and monitor these activities to
ensure compliance with regulations, data privacy policies, and security
requirements.

38) What is the use of the Message field on the client


script?
The message field is a multiline field in the client script and it is used to
display messages on the form. You can use this field for
Internationalization or to not hardcode messages within scripting (could
be used for English language as well).
Within this field, you would mention the sys_ui_message record (the key).
In the Client Script, you could reference that message by using
getMessage()

1) Navigate to system UI -> Messages and create a new message

2) Create a client script


3) In the message field , add the key i.e
display_message_in_client_script

4) Use the below script


5) Load the form and see the error message box displaying because we
have used addErrorMessage Function.

(Virtusa First Technical Round Questions


[33 – 36]

39) Transform Scripts


Transformation events occur during the process of transforming an import set table onto
a target table. Transformation Event Scripts modify the transformation behaviour at
different points in the transformation process. The When field choices are:

 onStart: executes at the start of an import before any rows are read

 onAfter: executes at the end of a row transformation and after the source row
has been transformed into the target row and saved

 onBefore: executes at the start of a row transformation and before the row is
transformed into the target row

 onChoiceCreate: executes at the start of a choice value creation before the new
choice value is created

 onComplete: executes at the end of an import after all rows are read and
transformed
 onForeignInsert: executes at the start of the creation of a related, referenced
record before the record is created

 onReject: executes during foreign record or choice creation if the foreign record
or choice is rejected; The entire transformation row is not saved

40) Scheduled Data Imports


Schedule imports to make it possible to specify that certain import operations
occur at a regular interval.

To create a schedule data import:


1) Navigate to System Import Sets -> Administration -> Scheduled Imports
from Application Navigator.
2) Click On New to create a new record
3) Provide it a Name , a data source to run , timing.

Optional) Provide Conditions or add pre or post script as per the requirement.

41) Scheduled Data Exports


42) Server-Side UI Action
43) Use Client and Server Script both in One UI Action
44) Calling Script Include from Client Script
45) Call Rest Message in a Business Rule
46) Widget to Widget Communication
47) Custom Action
48) Script Include
Script Includes are used to write Server Side Scripts which can be invoked later through
any Business Rule , Schedule Job , Flow Designer.
One can even create a client callable script include to fetch server data from Client Side
using GlideAJAX

49) GlideAJAX

GlideAjax allows client scripts to fetch server side code from script includes.
To use GlideAJAX ,

1) Create a client callable script include

This Script Include will fetch Current User’s Email and Name

2) Create a Client Script To Call this Script Include. You can create any type of Client
Script i.e OnChange, OnLoad, OnSubmit. OnCellEdit.
3) So now, whenever you load a Total Rewards Case, an alert will popup with
current logged in user’s email address.

50) An example where you have used [Link]() and


[Link]() in the same widget.

HTML :
CSS (optional) :
Client Script:
Server Script:
51) Report Visibility
52) ACL - Difference Between * and None
Table.* is a field level ACL which gives Access to all field on that table.

[Link] is a row level or table level ACL which allows you to access records or access
to the complete table.
Both are table level ACL, But the thing is * is a wild card entry. Suppose None is
restricting table level access and you provide access by using *, system can allow you to
do the work.

53) Difference between $scope and $rootScope in widget


$scope is used to communicate with embedded widget including both parent and child
widget whereas $rootScope is used to communicate with widgets on same page.

VIRTUSA SECOND ROUND


54) Javascript Libraries in ServiceNow Portal
55) UI Pages
UI pages can be used to create and display forms, dialogs, lists, and other UI
components. After creating a UI page , it can be called via a UI action or an Client Script
and can be shown as a Dialog Window or a Modal on the page.

To create a dynamic UI page , the application should be in global, hence the UI page will
also be in Global

To Create a UI page:

1) Navigate to System UI > UI Page


2) Add a title
3) Add the below code for HTML
4) Add the below code to Client Script
5) Client Callable Script Include for GlideAJAX
6) To Invoke the Code from a UI Action or Client Script and Show UI Page in
ServiceNow Modal Window

7) To Invoke the Code from a UI Action or Client Script and Show UI Page in
ServiceNow Dialog Window
There is a choice in step 6 and 7. The choice is yours as you can choose the Modal
window or the Dialog Window.

Result:

56) ACL on UI Pages


You can create ACL on UI Pages similarly like you create ACL.
1) Elevate your role to Security Admin
2) Navigate to System Security -> Access Control (ACL)
3) Click on New To Create New ACL.
4) Select Type as UI page
5) Select other fields as per your choice
6) Save the form

You have successfully created an ACL on UI Page

57) Virtual Agent for Agents


58) UI Scripts
UI Scripts are reusable global client side Javascript code which we can call
or run from other client-side scripts, such as Client Scripts, UI Pages. UI
Macros, HTML Code etc.
In other words, UI Scripts are package which store client side Javascript
that we can call from any other client scripts.

UI Scripts are not supported for mobile


You can create a UI script and designate it as global, which makes the script
available on any form in the system. You cannot create a global UI script in a
scoped application. You can mark a UI script as Global to make it available on
any form in the system.

To Create a Classless UI Script:


1) Navigate to System UI > UI Scripts
2) Click on New to create new
3) Fill the following fields

4) Check Global only If you want the script to be globally available.


5) Write the Script

6) Call in From Any Client Script


To Create A Classful UI Script:

Replace the Step 5 with the following code

And Replace Step 6 with following Code


59) UI Macros
UI Macros are modular, reusable components that can be used throughout the
ServiceNow platform.

UI Macros are discrete scripted components that administrator can add to the user
interface.

UI Macros typically are the control which provides input and information which is not
provided by existing field type. For ex: The action icon next to field, formatters etc.

To Create a UI Macro:

1) Navigate to System UI> UI Macros


2) Click On New to create a new UI Macro
3) Populate the following fields

4) Add the following Script and save the form


5) Now you can use this macro anywhere. Here I am using this on the caller field of
the incident table.
6) Go to the caller field and configure dictionary and modify the attribute field

7) Save the form and you can see the macro created beside the caller field.

8) Click on it and a popup should show all the incidents created for this caller i.e Abel
Tuter.
60) Create a Javascript Library
61) Group has group manager. How can we edit or remove
users as group manager?
62) Embedded List
63) GlideDate and GlideDateTime
64) Accept cookie banner on all pages
65) Calling Classless Script Include from Client Side
Classless Script Includes, also called On-Demand Script Includes contains only one
function and it cannot be called from the client side, even if the client callable checkbox
is checked.
However, you can call it from other script includes and make those script includes
classful and call them from GlideAJAX if required.

66) What is Classless Script Includes and why to use it?


Classless script Includes, also called On-Demand Script Includes contains only functions.

Classless script includes can be used for several reasons:

1. **Simplicity and Flexibility**: Classless script includes provide a simpler and more
straightforward way to encapsulate reusable logic without the overhead of defining
classes. They are especially useful for smaller, straightforward pieces of logic where the
complexity of classes may not be necessary.

2. **Procedural Programming**: If your development style leans more towards procedural


programming rather than object-oriented programming, classless script includes offer a
natural fit. They allow you to organize your code in a procedural manner without the
need for classes and prototypes.

3. **Rapid Prototyping**: For quick prototyping or scripting tasks, classless script includes
can be faster to write and easier to understand compared to setting up and managing
classes.

4. **Legacy Code Compatibility**: In systems where a lot of legacy code exists without
object-oriented patterns, classless script includes can seamlessly integrate with the
existing codebase without introducing a new paradigm.

5. **Performance**: In some cases, classless script includes might offer slightly better
performance compared to class-based script includes, as they don't involve the overhead
of creating and managing class instances.

6. **Easier Migration**: If you're transitioning from procedural code to object-oriented


code, starting with classless script includes might provide an easier transition path,
allowing you to gradually refactor your codebase.
However, it's essential to note that the choice between classless and class-based script
includes ultimately depends on the specific requirements of your application, your team's
coding standards, and the complexity of the logic you're implementing. Both approaches
have their advantages, and the decision should be based on what best fits your project's
needs and your team's preferences.

67) Variable Editor


68) GlideRecordSecure
69) Any alternative of GlideAJAX??
70) How to activate flow execution or flow reporting?
To activate the flow reporting

a) Navigate to Process Automation -> Properties


b) Find the Property Level of reporting data generated by the flow
engine
c) Select value for Flows and Actions
This will enable the execution report for Flows and Actions

71) Write a code to print top 3 callers with the greatest


number of incidents
72) If an ACL is restricting a user to view a field and an
ACL is allowing a user to see a field, will the user be able to
see the field or not
If there is an ACL, that is allowing user to view the field, then no matter how many
ACLs one creates on that field to restrict the view, user will still be able to see the
field.

73) Using an already existing HR Criteria in Record


Producer

a) When creating a HR Criteria, one can also create a User Criteria. It is


automatically created and you can manually create a User Criteria out of an HR
Criteria by clicking a Related link Create User Criteria

b) Navigate to your Record Producer-> Available for section and click on edit
c) Select the User Criteria created i.e Laptop Fixers (HR Criteria)

And that’s it.

74) Using a Business Rule in Client Script


Using g_scratchpad, one can use BR variables from client script, mostly Display Business
Rule.

Refer to Question no. 9 for more details

75) Without using ACL, restrict case creation for a HR


Service for a particular group. Ex:
Payroll group should not be able to create Benefits HR
Service and Benefits group should not see Payroll HR
Service.

COE to read/write payroll HR Cases


Similarly, create a COE security policy to allow only Benefits group to read/write benefits
HR Cases

76) In Which BR Can we use g_scratchpad?


g_scratchpad can be used in display business rule to set variables that contains server-side data.

Refer to Question no. 9 for more details.

77) Add subject person to CC in notification


To set the CC in a notification, follow these steps

a) Navigate to Email Scripts and Create a new record

b) Provide a valid name and add the following code


c) Use it in a notification with ${mail_script:MAIL_SCRIPT_NAME} i.e $
{mail_script:Add_CC_to_notification} in this case
d) Fire the notification and check sys_email table copied field.

78) Change the from field in Notification


To change the from field default value in a notification, follow these steps:

a) Open or create a notification


b) Navigate to What it will contain section and click on Advanced View related link

c) The From and Reply To field will be visible


d) Add a valid email address there and save the notification
e) Trigger the notification
f) Navigate to sys_email and check the user field

79) Show a Record Producer on Portal


80) Dictionary Override
Let’s say there is a field that is created in a table and is extended to all child tables. The
use case is that we need to make the field read only in child table, but making the field
read-only will make it read-only across table.

At this point, we can use dictionary overrides, to override dictionary for a particular table.

Example:

We can make assignment group field as read-only for incident table and it should remain
non-read-only for other parent tables.
We can configure the dictionary and add a new override for incident table.
81) SOAP Integration
82) What is the difference between Topic Category and Topic
Details
Certainly! Here’s a clear distinction between "topic category" and "topic detail":

Topic Category

Definition:

- A broad, high-level classification that groups related topics within a specific domain or
area of focus.

Purpose:

- To organize and structure the main areas of knowledge or activities.

- Helps in identifying major focus areas and facilitating resource allocation.

Example in HR:
- Talent Acquisition**

- Employee Development

- Compensation and Benefits

- Employee Relations

Topic Detail

Definition:

- Specific information, practices, guidelines, procedures, or case studies related to a


particular topic within a category.

Purpose:

- To provide in-depth knowledge and actionable guidelines.

- Helps in addressing specific issues or tasks within the broader category.

Example in HR (under Talent Acquisition):

- Recruitment Planning: Developing recruitment strategies and defining job descriptions.

- Candidate Sourcing: Using job boards, social media, and employee referrals.

- Candidate Screening: Standardizing resume reviews, phone interviews, and skills


assessments.

- Interview Techniques: Training on structured interviews and reducing bias.

- Onboarding: Creating comprehensive onboarding programs with orientation and


mentorship.

Summary

- Topic Category: Broad classification (e.g., Talent Acquisition).

- Topic Detail: Specific components or practices within that classification (e.g.,


Recruitment Planning, Candidate Sourcing).

This structured approach ensures that major areas are well-organized (topic categories),
while providing detailed guidance on specific tasks or issues (topic details).

83) Hierarchy of COE in HRSD

The Hierarchy of COE in HRSD is COE -> Topic Category –> Topic Detail -> HR
Service -> HR Cases

a) COE – Coe is the Center of Excellence. COE can be described as the table which
will represent a part of the HRSD functionality. Example -> Payroll can be COE
where all Payroll related cases like reimbursement, salary, hike, bonus
will be present.

b) Topic Category – Topic Category is a broad, high-level classification that groups


related topics within a specific domain or area of focus. Example: For Payroll
COE, Payroll Administration can be a topic category which will contain all the
other Topic Details.
Topic Category also helps in maintaining the knowledge base.

c) Topic Detail – Topic Detail is the in-depth details of the topic. It provides specific
information, practices, guidelines, procedures, or case studies related to a
particular topic within a category. Example: For Payroll COE, topics can be
reimbursement Payroll Salary or Payroll Others

d) HR Service – HR Service involves managing and supporting various functions


related to human resources within an organization.

Example: For Topic Detail - Payroll Salary, service can be Request advance
Salary or Request Variable Pay

For Topic Detail - Payroll Others, services can be Request a reimbursement


or request a salary hike

84) Difference between COE security and ACLs


COE Security Configuration manages access to whole categories of HR cases, while ACLs
control access to specific parts of those cases.

1. COE Security Configuration in HRSD:

- Purpose: Controls who can access different types of HR cases.

- Example: Decides which HR team members can see cases related to employee
benefits or employee relations.

2. Access Control Lists (ACLs) in HRSD:

- Purpose: Controls access to specific details within HR records.

- Example: Sets permissions for who can view or edit fields in an HR case, like an
employee's personal information.

85) Show or Hide fields based on HR Service without using


client script or UI policies
86) How do you know which release version of Service Now you
are working on?
Go to System Diagnostics->Stats and check the Build name.

Or navigate to [Link] and check the Build Name

87) On Incident table, let us say, user selects priority as high


(i.e Impact High and Urgency High). Write a BR to change the
priority [impact and urgency] to Moderate whenever high priority
is selected.

a) Create a before business rule that will run on Incident table

b) Add the following script in the advanced tab

c) Save the form and it will work.

88) Why do we need to impersonate a user in ServiceNow?


Impersonation allows users with the admin role to temporarily become another
authenticated user for testing purposes. When impersonating another user, the admin
user can see and do exactly what the impersonated user can do. Impersonation does not
require knowing the user's password.
89) What is the difference between UI policy and data policy?
UI Policy will work only on the form but not on List view. But if you create a data policy to
make a field mandatory based on some value, it will also work in list view. UI policies are
used to dynamically change the content of forms whereas data policies are used to
enforce data consistency.

90) How to use reporting in Service Portal


- To Use a report in the Portal, first create a report from the native view

- Use the Report Widget and Pass the Report Name and you have the report in the portal

91) How to encrypt payload during Integration


92) Mid Servers
93) How can I user Login without SSO or Password in
Servicenow. Usecase: Let’s say there is a new employee whose’
account is not yet created, how will he/she login?
94) Deactivating a Service Portal

Deactivating a Service Portal is not possible in ServiceNow. However, there


are other measures one can take to avoid the portal
a) Redirect User to a different portal by adding a widget
b) Modify the portal url suffix to something else
c) Change the home page of the portal to a 404 page

Any of the above measure can be implemented to restrict the user from viewing
it.

95) UI Pages (Refer to Question 49)


96) Calling a UI Page from a widget
97) Journey Accelerator vs Lifecycle Events
98) Configure a COE
99) Managerial in HRSD
100) Call a rest message from UI Policy
101) What is a COE
102) COE Security Policy
Center of Excellence (COE) Security Policy is used to define and enforce security
controls for specific modules or areas within the platform. This is particularly
useful for ensuring that sensitive information is protected and that only
authorized users have access to certain data and functions.

103) What all are the mandatory fields in COE Security Policy
There are no mandatory fields in COE security policy. However, one can write a
UI policy to make the fields mandatory

104) Limit the access of a Service Portal


To limit the access of a portal, you can follow the following steps:
a) Download the plugin [Link]-criteria from Plugins
b) Once downloaded, Navigate to Service Portal -> Properties and enable the
following property

Note: You must be in global scope for this activity

c) Now navigate to any portal page and load the related list, there you can see 2 items,
Can view and cannot view

d) Can view - Is for users who all can view the portal

e) Cannot view – Is for the users who cannot view the portal

f) Create or use existing user criteria.

105) ACLs in Client callable script includes


106) Drawbacks of using broadcast and emit function

The main drawback of using the `broadcast` and `emit` functions in ServiceNow Service
Portal is that they can create tight coupling between components. This means that if you
have multiple widgets or components relying on these events, changes in one
component can inadvertently affect others, making the system harder to maintain and
debug. Additionally, if events are emitted too frequently or without careful management,
it can lead to performance issues due to the overhead of handling numerous event
listeners.
EPAM – Round II

107) Consider a scenario, groups present in sys_group_table have


a field called counter.
Task is to update the counter by 1, whenever an incident is
resolved. Achieve this without using any GlideRecord or
GlideAggregate or GlideRecordSecure or Flows.

One can achieve this by using getRefRecord() function on a reference field of


incident.

A. Create a Before Business Rule on Incident table and add filter to trigger
when state changes to resolved
B. Use the following code and it is done.

108) Difference between UI policy and client script. Technical


difference
A. UI Policy cannot work on OnSubmit, whereas Client Script will work on OnSubmit
B. UI Policy cannot work on OnCellEdit, whereas Client Script will work on OnCellEdit
C. Client Script requires script to show or hide field whereas it is optional to write
script in UI policy as we have UI Policy actions
D. Client Scripts have access to old values in onchange scripts but UI Policy donot
have this feature

109) Difference between glide record and gliderecordsecure


110) Send XML as payload as receive JSON as body
111) Define HTTP Headers
112) GSFTSubmit
113) Staging table during import
114) Sort without using javascript sort function

ServiceNow – Round I

115) Predict the output of below code


It will execute the first console and then second console because, in third line we
are doing assignment and assignments always returns true.

105) Where can we check where our async BR is executing?


Async business rule can be found in sys_trigger table i.e scheduled table.
Filter on name with name contains Async and you can view all the async
business rules triggering
Refer to Performance considerations when using ASYNC Busine... - ServiceNow
Community

106) Why not to use [Link] in ServiceNow? Explain in detail


Imagine you're working with a form in ServiceNow, and you write some code to
automatically update certain fields when the form is saved. Now, when you save
the form, your code runs and makes changes. But then, if you use
`[Link]()` in your code, it's like telling the form, "Hey, save again!" right
after it was just saved.

Why This Can Be a Problem:

1. Infinite Loop:
- If your code tells the form to save, and then it automatically tries to save
again, this could keep happening over and over. The system might get stuck
trying to save the form repeatedly, causing performance issues or even crashing
the system.

2. Slower System:
- Every time you tell the form to save again, it makes the system do extra
work. This can slow things down, especially if you have a lot of records or if
multiple people are working on the system at the same time.

3. Unexpected Changes:
- When you save the form again, it might trigger other actions you didn’t
intend, like sending emails, updating other records, or triggering other scripts.
This can cause unexpected results and make it harder to understand what your
code is doing.

What You Can Do Instead:


- Just Set the Fields:
- Instead of telling the form to save again, just set the fields you want to
change. ServiceNow will automatically save these changes when your code
finishes running.
- Example: `current.field_name = 'new value';`

- Use Separate Logic:


- If you really need to update something else, you can create a new record
object (a `GlideRecord`) and update that. This way, you control what gets saved
and when.

By avoiding `[Link]()` in your Business Rule, you keep things simple and
prevent issues that could make the system behave unpredictably or slow down.

106) How to configure SSO in ServiceNow?


Reference Video -> [Link]
To Configure SSO in ServiceNow, follow these steps:
I. Install plugin : [Link] [Integration - Multiple
Provider Single Sign-On Enhanced UI]
II. Once Installed, navigate to Multi-Provider SSO -> Identity Providers and
Click New
107) How to show a modal from a UI Action (UI action can use OOTB
feature)?
108) Which widget to use to show virtual agent on custom portal?
To add virtual agent to custom portal, follow the following steps:
a) Navigate to Service Portal -> Widgets
b) Find Widget with name = Virtual Agent Service Portal Widget and copy the
widget id. [Note: Copy widget id, not the sys_id of the widget]. Example:
sn-va-sp-widget
c) Navigate to Service Portal -> Portals and Open your custom portal
d) Open the theme of the portal
e) Open the footer present in the theme
f) Add the following code in the footer:
g) Save the footer record
h) Make sure that the Fixed Footer checkbox is checked in theme, else your
virtual agent icon might float across the page.
i) Open your custom Portal and you will see the Virtual Agent

109) Get XML vs GetXMLWait vs GetXMLAnswer


110) Difference between _next, next()
110) Can lifecycle event be used for Request and RITM?

Jeevan Technologies Interview


Questions

111) I want ITIL user to only see his request on My Request


Widget
112) What functionality is changing the priority when impact and
urgency is changed on incident?
The Priority field on the Incident table is typically controlled by a combination
of the Impact and Urgency fields. This setup is configured through Priority
Lookup Rules (dl_u_priority).
113) I want the Assignment group field to be read only for ITIL users
and editable for rest. What is the best approach for form and list view?

The best way to do this is via Access Control List.

 Create a new ACL on Incident Table


 Type should be Write
 Field should be Assignment Group
 Check the advanced option
 In the script, write the following

And done
114) Write a code to print all the members of assignment group when
the assignment group changes on problem table.

On Change Client Script:

Client Callable Script Include:


115) I want to show an application item on left navigator (ex: Business
Application) to only ITIL users.

a) Navigate to The Application Navigator Menu Item that you want to modify.
(Business Applications in this example) and click on the pencil icon to edit
the menu.

b) Once the section is open, navigate to the Visibility Section.

c) Select the role you want that should see the menu item. (ITIL role in this
case)
And done.

Now only users with ITIL role can see this menu item.

116) property for disabling role in client callable script includes


To set Client Callable script includes as public,
a) Navigate to sys_properties.List and find a property named:
[Link].
b) If, present, set the value of the property to false,
c) Else, create the property with value of false.
117) Sys_mod_count
A numeric field that counts the number of updates for this record since record
creation.

118) Mutual Authentication


119) Table Rotation
120) Multi Row Variable Set
121) Integration – Suppose, we are fetching some data from some API
and that API returns data after 1 day, how can we add a delay of that 1
day?
122) How would you write an ACL in ServiceNow to ensure that only a
user with the itil_admin role can view the short_description field on a
record, while a user with the itil role cannot?
123) If a wildcard (*) level ACL is already defined for the
short_description field, will a user with the itil role still be able to view
the field, considering the ACL defined in the previous question?
124) How would you count and display the number of unique
combinations of category and subcategory in the incident table in
ServiceNow? Can you provide a script to achieve this?

125) Compare 2 dates in ServiceNow [Server Side]?


126) What is a known issue in ITSM?
127) Response and Resolution SLA
128) What is problem and change management in ITSM?
129) What are they types of Change Request In ITSM?
130) What is CMDB in ServiceNow?
131) What is ITSM and why is it used?

PORTAL QUESTIONS [Advance]

1. Dependency Injection
Widget dependency is ServiceNow widget allows us to use 3 rd party libraries
directly into our widget.

To Create dependency, follow these steps:


a) Navigate to Service Portal -> Dependencies
b) Click On New
c) Name your dependency
d) Save the form
e) In the JS include, select new and add the CDN of 3 rd party library

To use widget dependency, follow these steps:


I. Open any widget, where you want to add dependency
II. Scroll down to the dependencies section

III. To use existing dependency, click on edit and select the dependency

Now, you can use this injected dependency in your project.

2. Templates in Widget
Templates in widget are reusable piece of code, that can be used again in the
widget. It is majorly used to cleanup the code as template can be invoked using
only one line of code.
Ex:
Let’s say, we have to print hello world 10 times in a widget.
One option can be to write Hello world 10 times in a widget
Another option can be creating template with 10 hello worlds and calling it one
time in a widget.
To create and use a template, follow these steps:
a) Navigate to the desired widget and scroll down and find section called
Angular ng-template

b) Click New to Create New Template,


Template Name should be <template_name.html> ex: [Link]
c) Write your desired code and save the template

To use the template in the widget


In the html of the widget, type following:
ng-include=” ’<template_name.html>’ ”

3. Custom Directives
4. Custom Services
5. Cross Scope vs Restricted Caller
6. Calling API in Client Script
7. Attach file on a record via input type file on portal
8. Announcement in ServiceNow
9. Where ServiceNow keep track of users who have dismissed an
announcement.
Core Concepts Interview Questions

1. Sorting methods
2. Best Sorting Methods
3. Deboucing
4. Throttle

HRSD Interview Questions

Topic: Employee Journey Management

1. Difference between Human Resource: Lifecycle Event


application and Human Resource: Lifecycle Enterprise
application.
The main difference is that Lifecycle Event application only allows task to
remain inside the HR Scope whereas Lifecycle Enterprise allows task to be
assigned to outside of HR scope.

2. What are the roles installed with Lifecycle Event Plugin?


When either LE plugin [events or enterprise] in activated, several LE
specific roles are installed and each role begins with a prefix sn_hr_le.
Name of those roles are as follows
a. sn_hr_le.admin – LE Admin reader and writer roles for Activity and LE
Case.
b. HR Performance Analytics Admin
c. LE Activity Set Manager
d. LE Admin role is automatically added to HR admin
[sn_hr_core.admin] role.
3. What are all the necessary information a developer should
collect when mapping a LE, before any configuration begins
This includes a list of Activities, Assignment for each Activity, Task
Template requirements, HR Service details and HR Template requirements.
4. What is Activity Set
Activity sets represent the different stages in a Lifecycle event [LE]. For
example: in the New Hire Onboarding LE, preboarding, pre-hire and Day-1
are all activity sets. The task or activities, needed for LE are then grouped
into appropriate activity set so they will be created at appropriate stage in
the process.
Trigger conditions, display order and audience may all be defined on each
activity set.
5. Define Trigger conditions, display order and audience
Trigger conditions: Define when the activity set should be triggered/
initiated.
Display Order: Order number for when the activity set will be displayed
in the LE builder and in the activity sets timeline on the Employee Center
Page.
Audience: The specific employees of the activity set targets. Setting an
audience for an activity set allows you to create activities within an
activity set for a specific group of people. If the audience field is empty,
the activity set applies to all employees.
Note: One can also defined audience at activity level but the Audience
criteria for an activity set supersede or overrides the audience criteria for
an activity.

6. Define what all are the trigger conditions for an LE activity


set
The activity set trigger conditions field tells the system when an activity
set should begin, and the business rules control the behaviour. Options
are as follows:
a) Immediate: Activity sets triggers when a case is created
b) Date: Activity sets triggers before, on or after a specific date.
c) Other Activity sets: Activity sets triggers after one or more
activity sets have completed. When an activity sets is triggered by
other activity sets, it must wait for all dependencies to resolve
before triggering.
d) Advanced: Activity set triggers according to the conditions defined
in the trigger scripts
e) Condition: Activity set triggers according to conditions defined
using the conditions builder.
f) Combination: Activity sets triggers using a combination of any of
the other trigger conditions.

7. What are activities in LE?


Activities create case, request or task that are needed to fulfill a lifecycle
event case. Activities are the task needed to complete the Lifecycle event.
Each activity is associated with a single activity set.
Following are the activity types:
a) Approval
b) Employee Task
c) Fulfiller activity
d) Notification
e) Flow
f) Content
g) Activity Container

8. What is audience in LE?


The audience field allows lifecycle event activity or an entire activity set to
be triggered only for those who met certain condition

9. Why is an audience used in LE?


Audience records are used for several purposes:
a) Determine what an employee may view on the Employee Center.
b) Determine for which an employee to trigger a LE activity set.
c) Determine for which an employee to trigger an activity on a
Lifecycle Event
d) Define when new hires are displayed on the org chart page and the
My Team Widget in the Employee Center.

10. What will happen if no Audience is selected in LE?


If no audience is selected for any activity or activity set, each will trigger
for each Lifecycle event time.

11. What is Activity field mapping?

It is used to pass information from LE case to child case or task. It is used


to define the relationship between various fields in various tables.

12. What is Activity Container in LE?


Activity Containers allow you to manage the dependencies of activities
within an activity set. You can use activity containers to establish the
order in which activities should occur.
It is used when certain activities within an activity set need to be triggered
in order.
13. How to test a Lifecycle Event?
We can test a Lifecycle event by either creating a new case for that HR
Service or by clicking Test On Activity Set.
14. What is Rescind Activity Set?
Cancel and revert work done in a lifecycle event case with the Rescind process.
The Rescind activity set for LE allows admin to define the task that needs to be
completed to backout any work that has been done in a Lifecycle Event.
Use Case: A new hire decides not to join the company
Rescind activities can be used to send notification when a case is rescinded,
trigger automated flows and revert work already completed, such as return the
equipment back to inventory like Laptop, headsets etc or workplace setup.
Note: As a leading practice, it is recommended that a Rescind Activity Set be
configured for each Lifecycle Event.
Note: It is recommended that rescind activity sets should be configured for most
of the Lifecycle Events

15. What is Employee Request?


Employee Request tasks are not triggered by a LE but rather created when
an employee makes a request. Request can be either for a HR Service or a
catalog Item and they can be associated with multiple activity sets.
When an employee request is submitted, the activity set completion Is
depending on the fulfilment of the request. If a request is not made, the
activity set can still reach a completed state

Use Case: A new hire decides to delay their start date


Note: Employee Request can be configured by the LE Admin
[sn_hr_le.admin] or system admin.

16. Lifecycle Event Dashboards


Lifecycle event managers and fulfillers can track the progress of Lifecycle
Event and Onboarding Cases using the lifecycle event dashboards.
There is a dashboard showing results for lifecycle event cases and another
specifically for onboarding cases. The onboarding dashboard is further
divided by employee start date.
Note: If the customer has licensed Performance Analytics Premium and
the Performance Analytics – Content Pack – Human Resource Lifecycle
Events Scoped App [com.sn_hr_lifecycle_pa] plugin has been activated,
they may also view the Onboarding Executive Dashboard

Topic: Content Automation and


Campaigns

17. How can HR Admins configure information displayed


on the employee Center?

HR Admins can configure information displayed on the Employee Center.


Content Publishing: Present employees with information such as videos,
links to forum posts, links to news or articles, announcements, calendars
and banners
To-Dos: Employee can view and complete all their assigned task. It can be
configured to show approvals, content task, HR acceptance, HR task and
more
Requests:
Knowledge:
Catalog
Org Chart
Chat
Forums

18. What is Employee Document Management?


The ServiceNow Employee Document Management (EDM) application
provides storage space, a filing system and the ability to easily purge and
retrieved documents.
EDM meets organizational and company documentation challenges by
providing a centralized storage space. Controlling who can view the
documents, automating when to purge documents and allowing
documents to be put on legal hold. Essentially, EDM creates an
electronic version of physical filing cabinet for employee
documents
19. What is the use of Bulk Import Feature Of EDM?
It is common for an employee to have multiple documents associated with
them throughout their tenure. The Bulk Import Feature streamline the
uploading of those documents directly to HRSD as the goal is to not just
upload a virtual file cabinet worth of data but also to maintain the
integrity of the individual file folders within it.
20. From how many sources can we configure Bulk Imports
For EDM?
We can configure the bulk imports from:
 Local file storage
 3rd party cloud storage

Topic: Secure HRSD

21. What are the 3 primary aspects to ServiceNow


Security?
The three main aspects of ServiceNow Security are:
 Access to platform or Platform access:
o User Authentication: Local Login account with password,
SSO or LDAP service to authenticate user credentials
o Instance Restriction: IP Address Access Control
o Scoped Application: Protects application by identifying and
restricting access to the application files and data inherently.

 Roles and Groups:


o Roles: Allow users to access applications, modules, features,
capabilities, forms and portals. Ex: admin, HR Admin,
Delegated Developer etc.
o Groups: These are used to grant the roles. Users are added to
groups and each group member with inherit the group’s roles

 Contextual Security:
o Simple Security: Protect data from field level using roles and
controls the CRUD operations on data.
o Access Controls: Uses context of the data within record to
grant/restrict access, CRUD access of table, row and field
level.

22. What are Data Governance Methods?

 Client Masking: Can prevent users from entering personal


information in an HR Case. Create a new UI Macro to reference
jQuery along with using the input mask plugin

 Exclude Tables: When cloning an instance. Exclude the HR Profile


table so that it is not copied into non-production instances where HR
may have less control over security and access.

 Prevent access to tables: ACLs can be written that limit access to


tables. For example: if a Shared Service Center needs to access
payroll table, other tables can be made inaccessible to them.

 Encryption: Encryption Plugin Required. Encryption is a process that


scrambles information into a format that unauthorized parties can
not view.

23.
EPAM Interview Questions

1. How to show one catalog item or record producer on 2 or more portal


2. How to show an attachment related to a record in list view. Hint: Database
views
3. What will happen if we don’t check insert. Update, delete or query
checkboxes in Business Rule? Will the BR Run or will it won’t run? Explain
why?
4. Difference between Background Script and Fix Script
5. Difference between Catalog Item and Record Producer
6. OOTB method to create record based on choice
7. Suppose, I executed a Background Script and removed roles from some
users. Now I do not know which users, how can I revert this?
8. Scenario where you can use After Business rule and not Async Business
Rule
9. Script to get assignment group with highest number of incidents.
[Link] to get hierarchy of reportees .

You might also like