Search This Blog

Tuesday, April 19, 2022

HCL Interview Questions - Servicenow

1. What are the various ways to trigger Notification?

Ans: Notification can be triggered whenever                                        

 1)A record is Inserted or Updated into the Table

 2)The specified event is fired

 3)Via a Flow Action"


2. How many parameters are passed to eventQueue while writing BR to send notification? Tell the parameters.

Ans: 4 Parameters are passed to eventQueue in BR.                                                             

example: gs.eventQueue('event name', GlideRecord, parm1, parm2);"


3. If more than 4 parameters we want to pass how we can do that?

Ans: https://community.servicenow.com/community?id=community_question&sys_id=b45f0283dbea0c544819fb243996193b


4. What is the name of the approver table?

Ans: sysapproval_approver


5. If 10 approvers are there, and 9 approvers should get an approval request how we can do this?

Ans: Create approval activity by writing script to send approval to all other users except one user


6. How can we make the field read-only for a specific user or role?

Ans: By creating ACL


7. What is ACL? If the first ACL is created with a table. none and 2 roles admin and ITIL are assigned, the second ACL with table.* and 1 role admin is assigned. Who can read the data in a table?

Ans: ACL helps to control that what data user can access and how he can access it. Generally we provide CRUD access to users by specifying roles. Answer for the scenario is both can read records from the table as we are providing record level access i.e.table.none to both the roles


8. How can auto-populate the company field for requested for?

Ans: This we can achieve both with and without script. Without scripting Data lookup definition is used which will match the field of service catalog and set with specified field. With scripting we need to write Service catalog onChange Client script. As requested for value will get changed it will auto populated the required data in next field.


9. How to get server data at the client-side?

Ans: To get data from server at client side we can use any one from                                              1) g_scratchpad: At BR g_scratchpad variable is created and store the required data in it. and this g_scratchpad variable will be used in client script.

    2) getRefernce(): use it in a client script to retrieve the entire record of a reference field/variable

    3) GlideAjax: GlideAjax is a class in ServiceNow which is used to execute server-side code from the client-side. It is used by client-side scripts to send data to and receive data from the ServiceNow server. 


10. How g_scratchpad is used?

Ans: At BR g_scratchpad variable is created and store the required data in it. and this g_scratchpad variable will be used in client script.     


11. In which type of BR do we write g_scratchpad?

Ans: Display BR


12. What is Async BR?

Ans: same as After but here the process run in the background.when we don’t need that data right away.


13. What is the use of the onSubmit () client script?

Ans: onSubmit() client script will get executed when the user submits the form. The code written in this area is basically use to validate the form. 


14. What is GRC? Elaborate

Ans:GRC (governance, risk, and compliance) is an organizational strategy for managing governance, risk management, and compliance with industry and government regulations. Governance is the set of rules, policies, and processes that ensures corporate activities are aligned to support business goals. 


15. What is Vendor Management?

Ans: describes the processes organizations use to manage their suppliers, who are also known as vendors.


16. What new features of GRC are there in the Rome instance?

Ans: separate Workspace for Policy and Compliance,Risk,Audit 


17. What is a UI builder?

Ans: UI Builder enables developers to build new pages or customize existing pages for web-based workspace and portal experiences.


18. What is Business Rule?What are types of BR?

Ans: Business rule is javascript code which excecuted on server side.Four types of business rule display BR,Before BR,After BR ,Asysncronous BR 


19. Explain steps of GlideAjax?

Ans: https://www.basicoservicenowlearning.in/2019/12/glideajax-in-servicenow.html


20. What are ways to get data from server side to client?

Ans: There are 3 ways to get data from server side to client .1GlideAjax,2 getReference,3 using g_scratchpad  Glide Ajax is best practice 


21. On which module did you work?What type of BR did you write?

Ans: Worked on all modules of ITSM, I designed simple business rules for Incident, Service Requests & Task modules.

Tuesday, February 1, 2022

Service Now Interview Questions & Answers

 1) What is Service Now?

Service now is a cloud based ITSM tool. Which is used to automate your business process and provides a best service to customer all aspects of IT Services can potentially live in the Service Now ecosystem of modules, This allows for broad control of how to best allocate resources and design the process flow of those services.

2) Base or Parent Tables -- Child Tables

1. Task table (task) Incident, Problem, Change

2. Configuration item (cmdb_ci) Computer (ci_computer), Server (ci_server)

3. Users (sys_user)

4. Groups (sys_user_group)

3) Types of change

Normal change

Its normal change generally when developer want to make some changes, need CAB approval

Standard Change (Frequently)

Not required any CAB approval before make a change, its pre-approved cause of frequently doing the same kind of change

Emergency Change

When customer raise emergency request then respective developer needs to be implementing the changes immediately (with CAB Approval)

4) Tell me your experience with Service-Now?

Earlier my client was using BMC remedy tool; then they have decided migrate to Service-Now, so they have given training me on Service-Now. Initially my career was starts with just administration part but later I got a chance to working with other areas like in

5). Could you please tell me what all you have done in Service-Now?

I am involved in all kind of activities from basic administration to advanced scripting and customization. I have contributed my work in Incident, Problem, Change, SRM, Service Catalog and Asset and Configuration Management, Knowledge management, Discovery, Performance analytics areas. Recently I have started working on service Portal.

6) What is Incident?

Something is broken into your application or un expected interruption in your business application is called incident

7) What is Problem?

When incidents are occurring similar kind of issues from multiple peoples or same category we can consider as problem ticket.

Based on ticket trend analysis we can able to create problem ticket Then we can correct order for that so we can find root cause analysis need to be fixed the issue permanently.

8. Tell me about your work in incident management?

I have implemented lots of the changes of the forms using for layout and form design, created different kind of fields like reference field, choice field, string field, Data and Time, Calculated fields. Also I have worked on server side scripting like business rules and client side scripts like client scripts and applied UI policy, Data Policy, applying ACL rules to restrict users.

I have also designed the email templates for email notifications, and also triggering the notifications when the conditions are matched.

9) What do know about problem management in service-now?

Repetitive incidents will be logged as a problem ticket; technically I have done the same stuff which I have done for the incident management like business rules, client scripts, ui actions, ui policies, notifications.

10. Please share your experience on change management?

I have modified the workflow of change management table so that it can move for cab approvals as per the requirement, also I have created new workflows for emergency change request.

11. What is a business rule?

Business rule is a server-side script that runs when a record is displayed, inserted, deleted, or when a table is queried. Use business rules to automatically change values in form fields when the specified conditions are met.

Business rule are excuting from server side scripting that executes whenever a record is inserted, updated, deleted, displayed or queried. The key thing to keep in mind while creating a business rule is that when and on what action it has to execute. We have different operation like

12. Types of business rules?

Before

After the user submits the form but before going to perform any action is taken on the record in the database

After

After the user submits the form and ofter any action is taken on the record in the database

Async

When the scheduler runs the scheduled job is created from the business rule. The system creates a scheduled job from the business rule after user submits the forms and after any action is taken on the record in the database

Display Business Rule

Before the form is presented to the user, just after the data is read from the database

13) When business rules run?

Business rules run based on two sets of criteria:

The time that the business rule is configured to run relative to a record being modified or accessed.

The database operation that the system takes on the record.

14) What is display business rule?

Display business-rules:

Display business rules are processed when a user requests a record form.

The data is read from the database, display rules are executed, and the form is presented to the user.

1. The current object is available and represents the record retrieved from the database.

2. Any field changes are temporary since they are not yet submitted to the database. To the client,

3. The form values appear to be the values from the database; there is no indication that the values were modified from a display rule. This is a similar concept to calculated fields.

4. The primary objective of display rules is to use a shared scratchpad object, g_scratchpad, which is also sent to the client as part of the form.

5. This can be useful when you need to build client scripts that require server data that is not typically part of the record being displayed.

6. In most cases, this would require a client script making a call back to the server.

 

To populate the form scratchpad with data from a display rule:

// From display business rule

g_scratchpad.someName = "someValue";

g_scratchpad.anotherName = "anotherValue";

// If you want the client to have access to record fields not being displayed on the form

g_scratchpad.created_by = current.sys_created_by;

// These are simple examples, in most cases you'll probably perform some other

// queries to test or get data

To access the form scratchpad data from a client script:

// From client script

if(g_scratchpad.someName == "someValue") {

//do something special

}

15) Abort a database action in a before business-rule?

In a before business rule script, you can cancel or abort the current database action.

In a before business-rule script, you can cancel or abort the current database action using the current.setAbortAction = true method. For example, if the before business rule is executed during an insert action, and you have a condition in the script that calls current.setAbortAction(true), the new record stored in current is not created in the database.

16) How to lock user accounts using by business rule script?

We can lock user accounts if the user is not active.

The following business rule script locks user accounts if the user is not active in the LDAP directory or the user does not have Self-service, ITIL, or Admin access to the instance.

Script

// Lock accounts if bcNetIDStatus != active in LDAP and user does not

// have self-service, itil or admin role

var rls = current.accumulated_roles.toString();

if(current.u_bcnetidstatus == 'active' && (rls.indexOf(',itil,') > 0 ||

rls.indexOf(',admin,') > 0 ||

rls.indexOf(',ess,') > 0 )) {

current.locked_out = false; }

else {

current.locked_out = true; }

var gr = new GlideRecord("sys_user");

gr.query();

while(gr.next()) {

gr.update();

gs.print("updating " + gr.getDisplayValue());

}

17) Before query business rules example?

We can use a query business rule that will be executes before a database query is made.

Use this query business rule to prevent users from accessing certain records. Consider the following example from a default business rule that limits access to incident records.

Name : incident query

Table : Incident

When : before, query

Script

if(!gs.hasRole("itil") && gs.isInteractive()) {

var u = gs.getUserID();

var qc = current.addQuery("caller_id",u).addOrCondition("opened_by",u).addOrCondition("watch_list","CONTAINS",u);

gs.print("query restricted to user: " + u); }

18) This sample business rule restricts the writing of the name field in the

sys_dictionary file when the entry exists:

// the element name cannot be written unless this is a new record (not yet in database)

function sys_dictionary_nameCanWrite() {

if (current.isNewRecord())

return;

else {

return false; } }

19) Difference between Business rule and script include?

A. Business Rule is something you want to run when anything will happen before/after database update/insert for that record, definitely there are other options as well (like display and query business rule) etc.

 

B. Script Include is like re-usable function, in simple example if you want to calculate the date different between two date fields from incident form or change form then you can have 1 script include and can have a Glide Ajax to call from client scripting to re-use them for both the places.

20) How to converting global business rules to script includes

Global business rules are from earlier versions of Service Now,

Before Script Includes. Developers are now supposed to use Script Includes instead of global business rules. Why is this?

Performance

Global business rules are evaluated for every server interaction. Every insert, update, delete, or query of a record. They are “global”. Script Includes are different. They are loaded on-demand and cached.

How to switch to Script Includes

If you have a number of global business rules you created on a previous version of Service Now, you can switch them to Script Includes.

Here is an example GBR I used in for GRC report that found all Controls not linked to Authoritative Source Content. The report isn‟t that important here, just how to convert that GBR to a Script Include.

New Script Includes

You‟re new Script Include. Just copy the GBR script you are using into the Script Include. You can convert to a more object-oriented format if you want, but that is a bonus with accompanied risk of a coding mistake. The most efficient solution is just to copy the script.

21) How to deactivate Global Business Rule

Your Existing GBR. Either delete or deactivate. I choose to delete so that my past mistakes are gone forever.

Business Rule

Name: getControlsNotLinkedtoASC

Table: Global [global]

Active: false

Script:

getControlsNotLinkedtoASC();

function getControlsNotLinkedtoASC() {

var controlList = new Array();

var grControl = new GlideRecord('grc_control');

grControl.query();

while (grControl.next()) {

var grControlAuthSource = new GlideRecord('m2m_control_auth_src_content');

grControlAuthSource.addQuery('control_name', grControl.sys_id);

grControlAuthSource.query();

if (!grControlAuthSource.hasNext()) {

controlList.push(grControl.control_id.toString());

}

}

return controlList;

}

22) What is a client script?

Client Script which runs on browser side or client side. This can be triggered on load, on change, on submit, on cell edit.

OnLoad(): will run while loading a page,

OnChange(): will run while changing the cursor from the specified field,

On Submit(): when a form is submitted. This type allows you to cancel the submission, if necessary.

OnCellEdit(): Runs when a cell on a list changes value.

Examples

onLoad() Scripts

An onLoad() script can runs when a form is first drawn and before control is given to the user to begin typing. Typically, you use an onLoad() script to perform some client side manipulation of the document on screen.

An onLoad() script must contain a function named onLoad(). Otherwise, it is entirely up to you what your script does after it gets to the client.

For example, here is a trivial onLoad() script that displays a message box that says "Loading ..." while the page loads.

function onLoad() { alert ('Loading ...'); }

onSubmit() Scripts

An onSubmit() script runs when a form is submitted. Typically, you use an onSubmit() script to validate things on the form and ensure that the submission makes sense. As such,

onSubmit() scripts can potentially cancel a submission by returning false.

An onSubmit() script must contain a function named onSubmit().

For example, here is an onSubmit() script that prompts the user to confirm that a priority one ticket should really be submitted. If the user clicks Cancel in the confirmation dialog box, the submission is canceled.

Example

function onSubmit()

{

var priority = g_form.getValue('priority');

if (priority && priority == 1)

return confirm('Are you sure you want to submit a priority one ticket? The CIO will be notified!');

}

onChange() Scripts

A.Unlike onLoad() and onSubmit() scripts, onChange() scripts apply to a particular widget on a form rather than to the form itself. They are fired when a particular value changes on-screen.

An onChange() script must contain a function named onChange().

All onChange() scripts are called with several parameters:

Example

For example, here is an onChange() script that notifies the user whenever the short description field on a form changes.

function onChange (control , oldValue , newValue , isLoading ) {

alert('you changed short description from ' + oldValue + ' to ' + newValue); }

To prevent an onChange() script from running when the form loads, add the following to the top of the script.

if(isLoading) { return; }

onCellEdit() Scripts

Scripts can be defined as onCellEdit() to run on the client side when the list editor interacts with a cell.

Note: onCellEdit() scripts do not apply to list widgets on homepages or dashboards.

An onCellEdit() script must contain a function named onCellEdit().

An onCellEdit() script takes the following parameters:

Example:

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

{

var hasDifferentValues = false;

for(var i = 0; i < oldValues.length; i++)

{

var oldValue = oldValues [i];

if (oldValue != newValue)

{

hasDifferentValues = true;

break; }

var success = hasDifferentValues && performSomeFurtherValidation(sysIDs, table, oldValues, newValue);

callback(success); }

23) What are the variable supporting to client scripts?

The following API is supported via g_form:

g_form.setDisplay(name, display)

g_form.setVisible(name, visibility)

g_form.setMandatory(name, mandatory)

g_form.setValue(name, value, display_value)

g_form.getValue(name)

g_form.setReadOnly(fieldName, boolean)

24) How do I call a business rule from a client script?

To call a business rule from a client script, use GlideAjax

25) How to call business rule from client script through coding?

The Glide Ajax class enables a client script to call server-side code in a script include.

To use GlideAjax in a client script, follow these general steps.

Create a GlideAjax instance by calling the GlideAjax constructor. As the argument to the constructor, specify the name of the script include class that contains the method you want to call.

Call the addParam method with the sysparm_name parameter and the name of the script-include method you want to call.

(Optional) Call the addParam method one or more times to provide the script-include code with other parameters it needs.

26) How can we execute server side code in client script?

Execute the server-side code by calling getXML ().

27) What is difference between getXML and getXMLWait?

getXML()

It is the preferred method for executing the code, because it is asynchronous and does not hold up the execution of other client code. Another method,

getXMLWait(),

It is also available but is not recommended. Using getXMLWait () ensures the order of execution, but can cause the application to seem unresponsive, significantly degrading the user experience of any application that uses it. getXMLWait () is not available to scoped applications.

28) Call glide Ajax into Client script with Example

var ga = new GlideAjax('HelloWorld'); // HelloWorld is the script include class

ga.addParam('sysparm_name','helloWorld'); // helloWorld is the script include method

ga.addParam('sysparm_user_name',"Bob"); // Set parameter sysparm_user_name to 'Bob'

ga.getXML(HelloWorldParse); /* Call HelloWorld.helloWorld() with the parameter sysparm_user_name set to 'Bob'

and use the callback function HelloWorldParse() to return the result when ready */

// the callback function for returning the result from the server-side code

function HelloWorldParse(response) {

var answer = response.responseXML.documentElement.getAttribute("answer");

alert(answer);

}

29) Catalog Client Script Examples and Scenarios

Example: 1

Get the value of a variable

Use the following syntax to obtain the value of a catalog variable. Note that the variable must have a name. Replace variable_name with the name of the variable.

g_form.getValue('variable_name');

Example: 2

Restrict the number of characters a user can type in a variable

This is an example of a script that runs when the variable is displayed, rather than when the item is ordered.

functiononLoad()

{var sd = g_form.getControl('short_description');

sd.maxLength=80;

}

Example: 3

Color Code Approval Buttons

I use this one often. Color code the approval buttons so that they are easier to notice.It is tempting to use this for many color changes in Service Now. How use Field Styles instead as much as possible.

Client Script: Approval Button Color

When: onLoad

Script:

function onLoad() {

var approveButton = document.getElementById('approve');

var rejectButton = document.getElementById('reject');

if (approveButton) {

approveButton.style.background='green';

approveButton.style.color='white';

}

if (rejectButton) {

rejectButton.style.background='red';

rejectButton.style.color='white';

}

}

Example: 4

Pop an alert to the screen if a value is true

Client Script: Awesome Check  

   

 

Type: onChange

Field: u_awesome_check

Script:

function onChange(control, oldValue, newValue, isLoading) {

if (isLoading || newValue == '') {

return;

}

if (newValue == 'mike_awesome') {

alert('Yes this is true');

}

}

Example: 5

CALLBACK FUNCTION

Callback functions are make JavaScript far more flexible than it would be otherwise.

Typical functions work by taking arguments as input and returning a result. Functions take an input and return an output. JavaScript callback functions are different. Instead of waiting for a function to return that result, you can use a callback to do this asynchronously. This not only helps with performance, it strongly encouraged to use callback functions and asynchronous programming.

Client Script: Set VIP

When: onChange

Field: caller_id

function onChange(control, oldValue, newValue, isLoading) {

var caller = g_form.getReference('caller_id');

if (caller.vip == 'true')

alert('Caller is a VIP!');

}

Example: 6 with a callback (recommended)  

   

 

Client Script: Set VIP

When: onChange

Field: caller_id

function onChange(control, oldValue, newValue, isLoading) {

var caller = g_form.getReference('caller_id', doAlert); // doAlert is our callback function

}

function doAlert(caller) { //reference is passed into callback as first arguments

if (caller.vip == 'true')

alert('Caller is a VIP!');

}

Example: 7 with a callback (recommended)

Client Script: Set VIP

When: onChange

Field: caller_id

function onChange(control, oldValue, newValue, isLoading) {

var caller = g_form.getReference('caller_id', doAlert); // doAlert is our callback function }

function doAlert(caller) { //reference is passed into callback as first arguments

if (caller.vip == 'true')

alert('Caller is a VIP!'); }

Example 8: remove option from choice list

This is an easy client script. Remove a value from a choice list if something is set.

Client Script: Category Inquiry Remove Impact 1

When: onChange

Field: Category

Script:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

if (isLoading || newValue == '') {return;}

if (newValue == 'inquiry') {

g_form.removeOption('impact', '1'); }

30) What is UI Scripts

UI scripts provide a way to package client-side JavaScript into a reusable form, similar to how script includes store server-side JavaScript. Administrators can create UI scripts and run them from client scripts and other client-side script objects and from HTML code.

Note: UI scripts are not supported for mobile.

31) What is a record producer?

A record producer is a type of a catalog item that allows users to create task-based records from the service catalog. For example you can create a change record or problem record

using record producer. Record producers provide an alternative way to create records through service catalog.

32) Can we create record producers from tables?

Yes

33) How to redirect after Submitting a Record Producer

To redirect an end user to a particular page after the record producer is submitted, define the redirect link in the Script field using any of the following:

producer.url_redirect: Enables the redirect behavior within the Platform UI.

producer.portal_redirect: Enables the redirect behavior within Service Portal.

For example, the following code redirects users to their homepage after the record producer is submitted:

Within the Platform UI:

producer.url_redirect="home.do";

Within Service Portal: producer.portal_redirect = "? id=sc_home"

The following code gives the id of the record producer:

RP.getParameterValue('sysparam_id')

34) What is dictionary override?

Dictionary Overrides provides the capability to override several properties of a field in extended table. For example change table is extended from task table. There is a field named status in task table and set as read-only. When we use this field in change form it will show be a read only. We can set this to non-read only by using the dictionary override. Similarly there are other properties that can be set for the fields in extended table.

35) What do you mean by coalesce?

Coalesce is a property of a field that we use in transform map field mapping. When we set the coalesce as true for a field mapping it signifies that this field will work as unique key. If a field match is found with the coalesce field, then existing record will be updated with the imported information in target table else a new record will be inserted into the target table.

36) What are UI actions?

UI actions are helpful to create buttons and links on form as well as list. These ui actions script will run only when we click on that ui action.

37) What kind of script can we write in UI action?

We can write both client side and server side script in UI action. To write Client side script we need to check the property box against client field. It asks for “on click” function. We need to start the script with function which we have mentioned in on click field.

For server side scripting we can directly write the script.

38) What are UI policies?

UI policies are alternative to client scripts. It can be used to set a field as mandatory, read-only and visible on a form. You can also use UI policy for dynamically changing a field on a form.

39) Can we do scripting in UI policies?

Yes we can, when we tick the advanced check box, it displays script field. There we can write client script like g_form.setMandatory, g_form.setVisble, g_form.setreadonly.

40) What is a data policy?

Data policy checks the mandatory and read-only of a field whenever a record is inserted or updated through a web-service or import set. For example: If a mandatory field in the incoming record (from import set or web-service) is empty then the data policy will not allow to insert that record into the table.

41) What is difference between UI policy and data policy?

UI policy acts when a record is inserted or updated through a servicenow UI i.e. servicenow forms while data policy acts whenever a record is inserted or updated into database through any means.

42)What is Schema map?

The schema map displays the details of tables and their relationships in a visual manner, allowing administrators to view and easily access different parts of the database schema.

43) What is your experience in Notifications?

I have written email templates, and used in notifications. Also I have created 2 kinds of notifications 1) sending the notifications when a record inserted or updated 2) sending an email when an event is triggered.

44) Please tell me the process of triggering event based notifications?

To create an event we need to create a record in event registry. That event can be used in notification, we need to select the notification as “when event triggers” and use the event in business rule with the function “gs.eventqueue”.

45) What is a dictionary?

It is a table which maintains the information of all the tables and fields.

46) Did you work on SRM? (Service request management)

Yes, I have worked on Service Catalog. (Note: SRM = Service catalog in ServiceNow)

47) Could you please tell me your experience in SRM?

I have created catalog items with variables and variable sets. I have used workflows

And execution plans to design the workflow of a catalog item.

48) What is a workflow?

A workflow diagrammatic approach to design the process of a catalog item.

49) Could you please briefly explain about how to design the workflow?

Go to the workflow editor, these you can find an IDE. Click on the new to create a new workflow. After finishing the design by using different activities then publish the workflow.

50) What is an execution plan?

It is an alternative to the workflow to design the process of a catalog item. It can be done by using ui customizations.

51) How to choose between a workflow and execution plan?

Depends on the complexity of the design we need to choose. If the design is really complex then we can go for workflows.

52) How to create tables in Service Now?

Go to “tables and columns”, there you can create application, modules and respective tables

53) What kind of roles typically we have in service-now?

Ess (self-service), ITIL, admin.

54) Do we have any cheat codes to open tables and forms for which we don’t have access?

table_name.do and table_name.list

55) How can we restrict the users seeing the application and modules?

We can give roles to access a specific applications and module.

56) What are access control lists?

An ACL is access control list that defines what data a user can access and how they can access it in service now.

57) How many types of access controls do we have?

Record, UI Page, Processor and client callable script include.

58) Can we have a template without a form for a table? (OR)

Do you have any idea on Record Producer?

Yes we can create a record Producer.

59) What is a Record Producer?

A record producer is a type of a catalog item that allows users to create task-based records from the service catalog. For example you can create a change record or problem record using record producer. Record producers provide an alternative way to create records through service catalog.

60) What is the difference between Record Producer and catalog item?

Catalog items are for SRM and create a ticket in request table which has request items and tasks, whereas record producer is a template to insert a record in any required table.

61) How can we write a transform map?

We can develop them in 2 ways –

1. Direct field mapping

2. Scripting

We need to select the target table and transform them by using these 2 methods.

62) Have you done any integration with Servicenow?

Yes, I have done email integration and REST Integration

63) Could you please explain about email integration?

We use inbound action to create email integration. We have given a specified format to “Orion” system. As soon as some alert comes in Orion system, it generates an email to ServiceNow in a specified format. By using an inbound action scripting we have created an incident ticket.

64) What kind of email the inbound action accepts?

It accepts New, Forward, Reply emails.

65) What kind of basic administration work you have done?

I have done like adding users to groups, assigning Roles to users and groups.

66) How many instances your current project has?

We have 3 instances 1) Dev 2) Test 3) Production

67) How do you migrate the customization and code into different instances?

We use update sets.

68) Could you please tell me about update sets?

Update set is the group of customization which is used to capture all change in your instance. And move the changes to one to other instance

Go to the local update sets, create an update set and do the changes once changes are done, put the update sets in complete state.

For example if we made some configuration changes in our development environment and want same changes in our test environment then we can capture all the changes in an update set and can move this update set to the test environment instead of doing changes manually in test environment

69) How do you migrate update sets?

We need to go to Target instance and create an update source; we need to give credentials of the source instance. It will pull all the completed update sets of source instance to target instance and we need to commit them in target instance.

70) Did you work on Sla’s?

Yes, I have created SLA‟s as per the client requirement.

71) Could you please tell me the procedure for creating an SLA?

We go to Sla tables and select the table on which SLA need to be established and give start, stop, pause conditions to it.

72) What is the difference between SLA and OLA?

SLA is the agreement between Vendor and Client whereas OLA is the agreement within the organization.

73) Did you work in the knowledge management?

Yes, I have good knowledge in Knowledge management

74) What all you have done in knowledge management?

I have created knowledge articles, and make them available to specific rolled users.

75) What do we need to do to make a knowledge article available to all the users?

We need to assign public role to the knowledge article.

76) What kind of knowledge articles we can create in Service Now?

We can create attachment links, attachments, HTML pages etc.

77) How can we search a knowledge article?

We can use “Meta tags” for it. Whatever we give in the Meta tags, they can be the searchable elements for the knowledge article.

78) Could you please tell me the areas we can search for knowledge articles?

We have a module self-service application, and also we can search on any field which has a knowledge icon against it. For example short description in incident management.

79) What are the classes in CMDB?

Classes are tables for storing dedicated type os devices like servers, computers databases, data base instances.

80) What is a table extension?

We can extend any new table with one existing table. This brings all the existing table fields into the new table.

81) Could you name some extended tables?

Incident, Problem, Change are extended from Task table.

CMDB classes are extended from CMDB_CI table.

82) How does the ServiceNow Charges the Licenses?

On rolled users basis.

83) Do you have any idea on content management system?

Yes, I have worked on it.

84) What all you have done in CMS?

I have created new site through which ESS users can be redirected to the portal page when they login. As part of it I have created some pages using different blocks like iframes and dynamic blocks.

85) How can you redirect the users to portal page when they login?

We should use Login rules in content management system.

86) Do you recommend Service-Now over other tools? Why?

Yes, I recommend because of its flexibility to implement the applications also we can use JavaScript, JQuery, and HTML like more flexible web technologies.

87) Please tell me about Glide record?

It is java class which is used in scripting to bring the object of the particular table by which it is being used into a variable.

88) Did you work on LDAP integration?

No, That was done by a different team.

89) Do you have an idea on LDAP?

Yes, I have fixed couple of issue on LDAP. I know that LDAP will be used to import the users list from active directory to Users table in ServiceNow.

90) Did you work on Discovery?

No I didn‟t get a chance to work on Discovery.‟

91) Any idea what is discovery?

Yes, it is used to import different configuration items into different classes of CMDB.

92) What is scorecard?

Scorecard can be used to measure the performance of an employee or a business process. It is a graphical representation of progress over time. A scorecard belongs to an indicator. The first step is to define the indicators that you want to measure. Scorecards can be enhanced by adding targets, breakdowns (scores per group), aggregates (counts, sums, and maximums), and time series (totals and averages).

93)What do you mean by indicators in performance analytics in servicenow

Indicators, also known as metrics, business metrics, or KPIs, are statistics that businesses track to measure current conditions and to forecast business trends.

94) How to set the default value of a date field to current datetime value?

Goto the dictionary of the respective date-time field and set the default value as : javascript:gs.nowDateTime();

95) What is client transaction timing?

Client transaction timing provides more information on the duration of transactions between the client and the server.This require to activate the plugin - "Client transaction timing plugin".

96) What a set Workflow () function does?

setWorkflow(e) enables or disables the running of business rules that might normally be triggered by subsequent actions. If the e parameter is set to false, an insert/update will not be audited. Auditing only happens when the parameter is set to true for a GlideRecord operation.

Parameters: e - Boolean variable that if true (default) enables business rules, and if false to disables them.

97) What the setForceUpdate() function does?

setForceUpdate() updates the record even if there is no changes on the record.

98) What is the significance of setLimit(n) function.

setLimit(n) functions limits the number of records to query by Gliderecord().

100) How to get the row count in a gliderecord?

By using the getRowCount() function you can retrieve the number of rows. System pro

101) What is the difference between deleteMultiple() and deleteRecord()?

deleteMultiple() deletes multiple records according to the current "where" clause. Does not delete attachments, whereas deleteRecord() deletes single record.

102) What is Encoded query?

An encoded query string represents a complex filter on a list of records. Use encoded query strings to include a filter as part of a URL parameter, such as the sysparm_query URL parameter, or as a reference qualifier to restrict the data that is selectable for a reference field.

You can create encoded query strings manually or copy them from list filters.

103) Can we call BR (business rule) from CS (client script)?

Yes we can call BR from CS. Any GlideRecord query should be on the Server Side (Business Rule). You should instead write a Glide AJAX call in this scenario where you need to pass server side data to the client.

104) Can you update a record without updating its system fields (like sys_updated_by, sys_updated_on)?

Yes, you can do it by using a function autoSysFields() in your server side scripting. Whenever you are updating a record set the autoSysFields() to false.

example:

var gr = new GlideRecord('incident');

gr.query();

if(gr.next()){

gr.autoSysFields(false);

gr. short_description = "Test from Examsmyntra" ;

gr.update(); }

105) How to restrict users to upload an attachment in ServiceNow?

Following is the step wise step process:

1. Navigate to System Properties > Security.

2. In the Attachment limits and behavior section, locate the List of roles (comma-separated) that can create attachments: property (glide.attachment.role).

3. Enter one or more roles separated by commas.

4. Only roles listed in this property are able to upload attachments to a record. If no roles are entered, then all roles can upload attachments to ServiceNow forms.

5. Click Save.

106) What is the difference between ${URI} and ${URI_REF}?

${URI} shows the word LINK

${URI_REF} shows the display value of the record as the link text.

107) How to stop running background script?

Open 'All Active Transactions' under 'User Administration' and you can kill the running transactions.

108) Which object is used to refer the current logged in user in client script?

You can use the object g_user object to get the details of current active user

109) State the best practices of client scripts?

Few of the best practices to use client Scripts :

Enclose Code in Functions.

Aviod DOM manipulation, use g_form object.

Avoid global client scripting, etc.

110) How will you hide/show a field using client script?

You can use the g_form.setVisible(„fieldname‟, „value‟); method to show/hide a field using client script.

111) What do you mean by Metrics in ServiceNow?

Metrics record and measure the workflow of individual records. With metrics, customers can arm their process by providing tangible figures to measure, for example, how long it takes before a ticket is reassigned or changes state.

112) Define Service Now.

Service Now is an IT management tool that allows organizations to manage all aspects of their IT infrastructure including asset management, IT Service Management (Incident management, problem management, change management, etc.), CMDB etc.

113). What are captured in Update Sets?

Following are captured in update Sets:

1. Business Rules,

2. Client Scripts

3. Fields Forms and Form Sections

4. Reports

5. Tables & Views

6. Workflows

114). How can you capture data records in update set?

Data records can be captured, but you have to do it explicitly. From a list, check your records and then use the list UI action option “Create Application File”.

115). What is the condition to check which records will be captured within an Update Set?

The Condition is “update_synch=true “ .

Navigate to the sys_dictionary.

Personalize the list to include the Attributes column. Filter on Attributes is update_synch=true.

116). How to move customization to another update set without merging

Them?

To move the customization, open “sys_update_xml” table and update the “update_set” field with correct update set.

117). Define Workflow Scratchpad.  

a. The scratchpad in workflow is a space in the workflow context to store and share string based variables between instances of activities within an executing instance of a workflow.

b. Or, the scratchpad is a special field on a Workflow context that allows workflow activities to communicate data to subsequent activities.

c. Or, the workflow scratchpad is used to store data during the execution of a workflow. Values in the scratchpad can be set and/or accessed by any activity in the workflow.

d. The scratchpad is global to the instance of the running workflow and as such, is available equally to all activities.

e. Using the scratchpad requires at least two activities in a workflow, the sending activity which writes data to the scratchpad, and the follow-up activity which uses this data.

f. The scratchpad can hold variables of any JavaScript data type that can be represented as JSON.

g. You cannot add functions or scriptable Java objects, such as GlideRecord, to the scratchpad.

118). How can we declare Workflow scratchpad?

The scratchpad itself is automatically available to an executing workflow and requires no specific declaration. Variables are declared and stored in the scratchpad simultaneously by referencing it.

workflow.scratchpad.variableName = variableValue;

Or

var myValue = workflow.scratchpad.variableName;

119). List of Data Types stored by Workflow Scratchpad?

The workflow scratchpad can store multiple data types:

Primitive : Integers, Boolean Values, or Strings.

JavaScript object : User Data

Scriptable java Objects : GlideRecord or GlideDateTime

120). What is the difference between g_scratchpad and GlideAjax?

The primary difference between these methods is that g_scratchpad is sent once when a form is loaded (information is pushed from the server to the client),

whereas GlideAjax is dynamically triggered when the client requests information from the server. Other methods, GlideRecord and g_form.getReference() are also available for retrieving server information.

However, these methods are no longer recommended due to their performance impact. Both methods retrieve all fields in the requested Glide Record when most cases only require one field.

121). How we can get information from the server? And Among them which are the best ones.

We can get information from server using g_scratchpad, GlideAjax, GlideRecord, g_form.getReference(). The top ways to get information from the server are g_scratchpad and asynchronous GlideAjax lookup.

122). Illustrate g_scratchpad with example.

The g_scratchpad object passes information from the server to the client, such as when the client requires information not available on the form. For example, if you have a client script that needs to access the field u_retrieve, and the field is not on the form, the data is not available to the client script. A typical solution to this situation is to place the field on the form and then always hide it with a client script or UI policy. While this solution may be faster to configure, it is slower to execute. If you know what information the client needs from the server before the form is loaded, a Display Business Rule can

create g_scratchpad properties to hold this information. The g_scratchpad is sent to the client when the form is requested, making it available to all client-side scripting methods. This is a very efficient means of sending information from the server to the client.

For example, assume you open an incident and need to pass this information to the client: The value of the system property css.base.color Whether or not the current record has attachments The name of the caller‟s manager A display business rule sends this information to the client using the following script:

g_scratchpad.css = gs.getProperty(„css.base.color‟);

g_scratchpad.hasAttachments = current.hasAttachments();

g_scratchpad.managerName = current.caller_id.manager.getDisplayValue();

To access scratchpad data using a client script:

// Check if the form has attachments

if (g_scratchpad.hasAttachments) // do something interesting here

else

alert(„You need to attach a form signed by „ + g_scratchpad.managerName);

123). How can we declare Workflow scratchpad?

The scratchpad itself is automatically available to an executing workflow and requires no specific declaration. Variables are declared and stored in the scratchpad simultaneously by referencing it. workflow.scratchpad.variableName = variableValue;

Or

var myValue = workflow.scratchpad.variableName;

124). List of Data Types stored by Workflow Scratchpad?

The workflow scratchpad can store multiple data types:

Primitive: Integers, Boolean Values, or Strings.

JavaScript object: User Data

Scriptable java Objects: GlideRecord or GlideDateTime

125). Which one executes first UI Policy or Client Scrip?

UI policies execute after client scripts.

126. Does Client Scripts run on Lists?

Client Scripts do not run on lists.

127). Define GlideAjax?

The GlideAjax class allows the execution of server-side code from the client.

128) What is the use of sysparam_name in GlideAjax?

GlideAjax uses sysparm_name to find which function to use.

129) What is the use of getXML() and getXMLWait() functions in GlideAjax?

Code is executed with the getXML() or getXMLWait() functions.

130) What do you mean by Function names starting with “_”?

Function names starting with “_” are considered private and are not callable from the client.

131) What is the difference between getXML() and getXMLWait() in GlideAjax? getXML()

getXMLWait()

getXML is Asynchronous

getXMLWait() is Synchronous

getXML() is used when you want processing to continue, even if the results have not been returned.

getXMLWait() is used when you want to halt processing until the results are returned. This will halt everything and wait for it to finish and return the results

If you are retrieving some data from server and next tasks does not depend on what you are retrieving from server. Then will use getXML().

When you are trying to retrieve value of the variable. After getting value then only we can precede next step like comparing it with user input. In such scenarios will use getXMLWait().