You are on page 1of 27

Service Now training day1 -18th Jan 2023

 Used for – administrative work


o Support and ticketing
o Development
o Configuration and end user
 Mostly automated with intermediate knowledge of programming languages
 Certification charges: will be discussed later.
 It is PaaS and SaaS
 Create your own profile and raise a request for a free instance(Inactive if not used more
than 10 days)
 Check Products tab – IT Service Management to start
 Explore the learning path website
 Explore developer website- signup and start build
 Periodically we need to upgrade the instances (At least once in a year)
 If you have any issue we can issue ticket to service now development team
 Create instance or request instance
 Go through the release notes carefully
 Explore different url and go through
 PDI-Personal development instance
 Change password
Day-2 20th Jan 2023

 Profile
 Preferences
 Impersonate user
 Elevate Role
 Search global and service operation workspace
 Explore All Section
 Service portal home(End user)-You cannot make customization here made for end users
only,-also known as “Sp” Page.
 Do not customize service now core components heavily instead we can create our own
custom component because it will affect when service now roll out new update.
 Navigation- incident
 Request
24th Jan’23

 Change User name- Users->Admin->Change to desired value.


 Favourites- The options you use frequently we can add it.(Start Mark)
 History- Browsed history in descending order(last used will be displayed first), At most 30-40
activities.
 Workspaces- We’ll discuss later, are called readymade-dashboards. – Relevant info and can
be customized. mostly for developer’s, support engineer’s etc.
 Admin- Monitor the system performance, dashboard for admin.
 Globe icon- Application scope- changes made by default are global.
o Update set- Collection of updates
o Create your own update set
 Module – ITSM (IT Service Management)-
 Streamline the process for e.g. - raise an incident for laptop etc.
 Create a service CataLog for e.g. Flipkart products.
 Options- > Service CataLog explore- categories, mobiles, hardware’s.
 Create or modify form- Catalog item.
 Create a Catalog item.
 Catalog hierarchy – Catalog- Service Catalog, Technical Catalog, HR Catalog etc.
 Categories for eg Service catalog – Hardware.
 Solve Assignment on category creation. - edit, add and remove etc.
27th Jan ‘23
Access Control: elevate role to security admin and edit “incident assigned to role”

Explore Service Catalog and add catalog items with categories.

Create a form- Variables and Variable sets (Recommended)OR Form Fields.

Variable Sets- Edit and New explore.

Create new variables under created variable set.

Assignment on variables.

Explore all the request types in variables except containers.

30th Jan’23
Meta- search keyword

Multi row variable sets-single type of information can be captured multiple times

How to set parameters for field like read only, hidden etc.

Catalog UI policies and Catalog Client Scripts- IMPORTANT

Catalog UI policies- controls the behaviour of forms use configuration.

-Explore ‘Applies to’ option – It sets the scope of policies where applicable

- ‘When To Apply’ – On Load, ‘Applies on catalog item view.

- ‘Script’- discussed later

- Catalog Ui Policy actions.

Catalog Client Scripts- client-side validation and scripting use JS or ServiceNow

-UI Type- mostly use ‘ALL’

-Types- for eg- onLoad, onChange - will run on both load and change.
Jan 31st ‘23
Flow – how the things work when you select order now or add to cart.

Request items -RITM – Tasks are created under this like procurement and delievery etc

How to define them –

Go to -> my request(contains submitted requests)->Request Items-> catalog tasks, approvals and


group approvals.-> Page Layout -> assignment group and assigned to.

Client validation –
For script to apply on Ritem choose RITEM apply and similarly for catalog task.

Script:
g_form = important object in service now to access the form.

For getting the username/value= script use:

g_form.getValue(‘field_name’); and you can print it using alert.

For updating the fields:

g_form.setValue(‘fieldname’,”value”);

// Note: always select values not labels in case of dropdown, selectbox, etc.

//for every reference use ‘sysid’- how to get-> right click on record and copy sys_id. Useful in case of
duplicate data.
Feb 1st ‘23
Scripting continued.

API’s or ServiceNow Objects.

Create a client side script -RequestedFor_OnChange.

ga=GlideAjax() and GlideRecord()- documentation.

GlideRecord()- Used for fetching the records from table./ used for DBMS Operations.Not
recommended to use from client side so use Glide Ajax instead.

Syntax = GlideRecord(String table_name).

addQuery(String Name, Object Operator, Object Value):

Name-> Table Column name(Api Name)

Operator -> <, >, =, != (Optional Field)

Value = Exact value.

e.g code:

alert(newValue);

var gr = new GlideRecord(‘sys_user’);

gr.get(newValue);

//gr.addQuery(‘’);

alert(gr.email);

Also explore insert and update from the document.

Developer console= all-> background scripts for code.


Feb 2nd ‘23
Roles.

Task- create catalog client script, onload client script and print some alert.

Control- object which points to that variable.

isLoading- flag true or false.

newValue- user entered value.

Explore

Feb 3rd’23
No session.

Feb 6th’23
Doubt solving session on previous assignment.

Format code option.

Feb 7th ‘23


 Server side scripts and service now database.
 Update set are useful to export the instance configuration to another instance.
o -Export type: XML
o -To import the update set into another instance -> retrieve update set and
upload .xml file.
 Create new catalog server script update set.
 Glide Record :- Object to access database in ServiceNow.
 Not recommended for using in client side.
 Explore documentation of GlideRecord.
 For scoped applications do not call glide records directly for that purpose we use another
tool GlideAjax and ScriptInclude.
 Syntax -> GlideRecord(String TableName);

 e.g. of table name:


 Fetching data:
 Syntax -> addQuery(String name, Object operator, String Value);
o -Values are not case sensitive.
 Execute :
 Syntax -> query(Response); Where Response -> Callback Function.
 General Syntax -> query(name,func,value); where name and value are optional and func is
mandatory parameter.
 Create a Glide Record script to fetch incident records.
 Try this also:


Feb 9th ‘23
o Explore documentation.
o Insert :
o Syntax : Insert(Function responseFunction)
o

o 2nd line indicates which field you want to set the value.
o 3rd line create response function variable.
o

o Mandatory fields will not affect for this type of insert because it is backend insertion.
o Update record= query+insert
o Query= the field you want to update.
o

o
o Primary fields and duplicate value validations work only from table side.
o Delete records
o Run query and delete.

 Standard Practice:
 Always use filter on table side to verify the data and then set the logic and write the query.

 For similar records we can delete them based on number or sysid.


Feb 13th ‘23
GlideAjax:-
 Syntax = var ga = new GlideAjax(‘script include name/class’);
 It will take help of a class ‘ScriptInclude’


 To prevent access data from client side.
 It can be used from client script and UI Policy but not from Server Side.
 To add the data use ‘addparam’ method.

 Script Include:-> all-> script includes -> new.


 Client callable=> if you want client to call this.(*required)
 Inside pre-generated script create your new function:-

 Prototype: Instance of a class to initialize the class.


 Inside function fetch the parameters we have created.
 Client script:

 Refer GlideAjax documentation.


Feb 14th ‘23
 Glide Ajax continued: - Scenario: - on catalog item user will create name and manger and
when submit it will create new user with username and manager.
 Catalog Client Script:

 Script Include: (No need to write response function)

 Practice assignment and more queries from your own.


Feb 15th ‘23

onSubmit = validation eg –> restrict submission of catalogue item manually. Return


True/False.
Business rules/logic/restriction: - only applicable on table NOT 0n catalogue item etc.
purely server side.
-When to run condition.
-async: it won’t stop the action but it will get executed at the earlies.(any time).
-display: to help client side validation. For e.g.
-Filter: - Criteria to execute.
-Actions: - execute what to perform in business rule.
-Advanced: - Implement complex logic using scripts.
Business rule VS Script include

Executes automatically We have to trigger.


Business rule executes based on order.

Best approach – prefer script include.


16th Feb’23
Workflow:- List of tasks we define. Set of defined activities.
Catalog item-> Process engine tab-> flow / Workflow (Low code,no code
automation)/Execution Plan.
Table :- workflow_ide.do
Workflow only written on table not on client scripts.
New workflow->provide name and table.(Most of the catalog items we will
create workflow for requested item table)
->Stages=Stage rendering-defines how the stage will be displayed.(Workflow
driven most of the times, it displays according to workflow.)
->Stage order->computed.->submit.

Workflow properties.
 Schedule-explore -important.
 When we create new workflow ‘core’ tab will be enabled.
 Drag and drop any activity you want.
 Click publish otherwise it will not get saved.
Explore documentation.

FEB 17th ’23:


Workflow continued….

Core activities.

Workflow activity -Approval process: Activity properties: Approval User

Workflow activity: - new record.

Drag and drop dashboard.

Condition: If Statement: for field select variables first then select the variable item.{For e.g. VPN
category->variables->’When do you need this’ field}.

You can even customize the condition yes no labels.


Explore edit stages and properties for workflow.

For checking the approvals we can impersonate to that particular user->My Approvals section.
Feb 20th ‘23
Advanced Workflow activities:

Switch Statements.

Wait for condition: when we want to execute two parallel tasks.

Create event

Notification.

Timers: To add some delay in the workflow.

Feb 23rd’ 23
Branch: Splitting

Join: Unite multiple concurrent execution paths.

Run Script: To execute JavaScript scripts. You can directly use server side scripts.

Copy Activity.

Create event and how to trigger notification based on the event:

For event -> All->Events-> Registry.

Event: insert, update delete record are events.

First will register the event in the registry.

*Event name should not be duplicate.


For notifications:

All->Email-> Notifications

Dynamically changing the email values use ‘$’.column_name

Syntax: ${column_name}.

Create your own notification and explore possible options.


Feb 27th ‘23
Assignment task12: use business rule -> scratchpad script and client script.

g_scratchpad: is the best way whenever we want to fetch the data from the server and show it to
client, it does the job asynchronously instead of g_form.getReference() function.

Advanced notification: Header script and footer Script.

Scheduled jobs:

Automated piece of work that can be executed at specific time period.

All->System definition -> Scheduled Jobs.

New-> select any one out of three templates.

Run->Duration.

Run script-> Server side code, glide record etc.


e.g:

Calling the function:

gs.getEventQueue()-> explore.

Feb 28th ‘23


All-> Reports
Share the report:

Multidimensional reports: if we want multiple information on single table.


Create tables:

All->System definitions->tables and columns.

Extend table-> child table we are creating will inherit all the properties of parent table.

Create module: left side navigation in all section

Controls: new role whenever we create new table.

Create access control: to get access of read/write/delete access to the table.

Auto number: auto increment

Application access: to give app access on w/r/ex.

1st march 2023

 Application menu control


 Module
 UI Scripts- validate client script function (Purpose-you can call(functions) it from ui policy or
through ui action(you can call it from ui script) Service now will triger this ui script.- we can
 Access it from any client script.

 Cool Clock - Analog java script


 UI Script - New record

 Macros - you need to display some URL which user can click on and it will redirect to some
other site.(created using jelly script) g:evaluate - it will evaluate the value

 Macro - new record - create a Marco variable- type specifications - widget, macro.

6 th March

 UI action
 Jelly tags

13th March

 App Engine Studio

 How to create a custom app (its a low code app)


 Service now homepage->lets go->New interface has opened
 Different Templates

 Create from scratch, create from existing table, check products

20th March
Service level agreement
SLA definitions> -> target-> Response and resolution.
Type->SLA, ULA, Underpinning contract

21st March
Create new update set in which we will be capturing it.
Order guides- we can combine multiple catalogues.

Rule base-Include this item


Data source - you need to load the data

22nd March
Script include, Reporting requirement policy
Create update set and capture everything

You might also like