Sunday, September 20, 2015

How to hide application in mobile view, How to disable Mobile UI Plug in Service Now ? How to make a form read only on Mobile View ?



I just recently come across one requirement, that is need to disable the whole Incident form Read only on Mobile view only..

 Approach 1 - Avoid displaying applications in Mobile view

Solution 
 - Search for 'System Mobile UI'
 - Choose 'Navigate Apps'
 - It will display all the available applications, select the application which you don't want to display on mobile view, set 'Active = false'





Approach 2 - Disable Mobile UI plug in

Solution
 - Search for ' Plugins'
 - Look for 'Mobile UI' plugin
 - Request Service Now to disable this plug in,



Approach 3 - Make the whole form Read only on mobile UI

Solution

- Create UI Policy for the form which you want to make it read only
-  Create an UI action for each field which you want to make it read only for the above newly created UI Policy
- In the UI Action for the field, set 'Read Only = true'



Friday, June 19, 2015

Challenges in Service Now


This blog explains most of the challenges faced so far in my experience

- Design a custom calendar Page, Based on custom tables and out of box tables. For eg : There is a table called 'Business Events' , users can create as many as business events with start and end date. All these business events should be appear in custom calendar page as per their scheduled time frames.By placing mouse cursor on the calendar, display specific event information by mouse hover.

- Create a JDBC data source to fetch data from one system to other system, and target should system should have live feed. That means whenever new record inserted/updated/deleted those changes should reflect in target table right away without any delay

- Write a simple background script, iterate through all the records in a table, identify what are the composite unique fields 

How to Promote a field in Service Now ?


This very common requirement in any Database to extend a table. Developers must be very careful when designing the DB tables and organizing the data. If you are already in middle of the development and encountered that there are more than one table need to share the same fields which are common in all the tables, then create a parent table and promote the commonly used fields into parent table, so that all the child tables can share the fields.


Syntax : 

GlideDBUtil.promoteColumn('table_to_move_from', 'table_to_move_to', 'field_to_move', true);


Example : Let's say I want to move 'category' field from 'incident' table to 'task' table
 GlideDBUtil.promoteColumn('incident', 'task', 'category', true);


Reference : http://www.servicenowguru.com/scripting/promote-field-extended-table-servicenow/

Wednesday, June 3, 2015

How to Create a Module based on URL


This blog explains about how do you create a Module based on URL :

Scenario : For example, I want to create a new module called 'Search' , By clicking on this I want to display one of the UI page created in Service Now.


- Launch Service Now Instance

- Edit the application where you want to create new module, ( Right click on Application -> Edit Application Menu)

- Create new module

- Choose 'Link Type' as 'URL Arguments'

- Provide the URL in 'Arguments'

- Save, Refresh, click on newly created Module, you should see the page.


Hint : If you want to see the URL for any specific Incident record, Open the incident in a new tab, copy the URL and paste it into Arguments.



Tuesday, May 26, 2015

How to mark fields as Mandatory on any form in Service Now ?


This blog explains about how to mark specific fields as mandatory on any form in service now ?

Scenario : I want to mark 'First Name' field as mandatory on a form, that means without entering the value for 'First Name' field and user tries to submit the form, should display required validation message

Steps to accomplish


- We can achieve this by writing UI Policies on a form.

- Launch the form where you want to to write the UI Policies

- Right click on form banner menu -> Personalize -> All -> Click on 'UI Policies' tab -> Click on New

- If it is 'Eureka' version, click on 'Default' link

- Choose the table name

- Click on 'New' on 'UI Policy Actions' section as highlighted below.

- Select the field name, and set 'true' to mandatory column.

- Save , launch the form, you will notice '*' symbol for mandatory fields.





How to invoke a client script by clicking on 'Submit' or onChange actions



This blog explains about how to invoke a Client script by clicking on 'Submit' button.

Scenario : For example, there are two date fields on the form, by clicking on 'Submit' button, validate date 1 must be before date 2. Perform this validation by clicking on 'Submit' button.

- Launch the form where you want to write the client script

- Right click on 'Form Header' -> Personalize -> All

- click on 'client Scripts' section

- Click on 'New'

- Below is how client script looks like




-  If you want to write invoke client script whenever any field value changes, for Eg : Whenever user enter a value for 'Date' field on a form.



















Wednesday, May 20, 2015

How to create a record into a custom table using business rule in service now?


This blog explains about how to create a business rule to create a record into custom table.

Scenario : Whenever new incident created, Newly created Incident Number and description should stored into a custom table called 'incident_backup' table


- Create a new table called 'incident_backup' with 'description' and 'number' fields.

- Launch 'Create New' Incident module

- Right click on 'Create New' incident form header -> Configure -> Business Rule

- Create a new business rule

- Give a valid name to the business rule

- When to run ? Choose 'Insert'

- Select 'Advance' check box

- Write a function as below

createIncidentBackupRecord();  // Invoking a function
// Function definition as follows below

function createIncidentBackupRecord(){
try{
// Create a glide record for the 'incident-backup' table
var gr = new GlideRecord("incident_backup");
gr.initialize();
// Set event start, event end, name

gr.short_description=current.short_description;
gr.number=current.number;

gr.insert();

}catch(Exception){
gs.log(" Create Incident Backup Record Exception Occured while creating Blackout Window"+Exception);

}
}

- Save the Business Rule

- Create a new incident record, as soon as new incident row get created, this will trigger above business rule, and this business rule will create a new record into 'incident_backup' table



How to Create a Module based on URL ?


This blog explains about how to create a Module using arguments or How to test only Catalog item ?

Scenario : Create a catalog item,  User don't need to 'Maintain items' Module every time to test the catalog item.

Steps

- Go to Maintain Items under Service Catalog

-  Search for the catalog item, for which you want to create a module, Press Ctl + Mouse click on the Name of the catalog item, That will launch the item in a new tab

- For example, below is how the URL looks like, once you open the catalog item in a new window

https://fmdev.service-now.com/sc_cat_item.do?sys_id=3ec4fde02bcc06001f1847f119da15cc&sysparm_view=item&sysparm_record_target=sc_cat_item&sysparm_record_row=1&sysparm_record_rows=175&sysparm_record_list=type%21%3Dbundle%5Esys_class_name%21%3Dsc_cat_item_guide%5Etype%21%3Dpackage%5Esys_class_name%21%3Dsc_cat_item_content%5Esc_catalogs%3DNULL%5EORsc_catalogsDOES+NOT+CONTAIN0b22fd2ad7021100b9a5c7400e610319%5EORDERBYDESCsys_updated_on

- Copy only the URL excluding https://xxxxx.service-now.com as shown above highlighted. URL should looks like below

sc_cat_item.do?sys_id=3ec4fde02bcc06001f1847f119da15cc&sysparm_view=item&sysparm_record_target=sc_cat_item&sysparm_record_row=1&sysparm_record_rows=175&sysparm_record_list=type%21%3Dbundle%5Esys_class_name%21%3Dsc_cat_item_guide%5Etype%21%3Dpackage%5Esys_class_name%21%3Dsc_cat_item_content%5Esc_catalogs%3DNULL%5EORsc_catalogsDOES+NOT+CONTAIN0b22fd2ad7021100b9a5c7400e610319%5EORDERBYDESCsys_updated_on


- Now Right click on the application where you want to create a new module

- Create New Module 

- Choose 'Link Type' as 'URL(from Arguments.)

- Provide a proper name to the Module

- Paste the above copied URL into 'Arguments' field.

- Refresh the URL and search for the Application, you will see a new module created in above step, If you click on you will see a catalog item, Enter the details and click on 'Try it'



Tuesday, May 19, 2015

How to activate service now plugins?


This blog explains about how to add plug-ins in Service Now

Plugins provide additional optional features that can be activated within a ServiceNow instance. The activation process varies by plugin.

- Search for 'Plugins' on left hand side
- Look for the already existing plugins available, choose the one which you want to active
- Click on 'Activate/Upgrade' Link
- This will take couple of minutes to update and activate.

Note : You should have right access in order to activate the plug-ins.

How to Request for your own Developer Service Now Instance ?




1.    https://developer.servicenow.com/app.do#!/home

2. Click on Sign up Now

3. Fill the details as displayed on screen, verify your email

4. Click on the link in your email, Sign on

5. Accept the agreement

6.Click on 'Manage'  -> "Instance ' Menu

7. Click on ' Request  Instance' Button

8. You will get the service now instance URL, Logn credentials, make not of them and start accessing/using with this info whenever you want.

Note : You have to keep using this URL to avoid termination of this instance.








Tuesday, March 17, 2015

Service Now Learning Notes




How to Practice ServiceNow

Please submit a request through Contact Us

Service Now Introduction

ServiceNow is a software platform that supports IT service management and automates common business processes. This software as a service (SaaS) platform contains a number of modular applications that can vary by instance and user. Articles in this category help new users learn what services ServiceNow offers. 

For More Info : Wiki ServiceNow Introduction

                     Service Now Introduction Part 1
                      Service Now Introduction Part 2
                      ServiceNow Form Design

Tables and Columns

                     How to Create Tables and Columns

ServiceNow Applications

Applications represent packaged solutions for delivering services and managing business processes. The ServiceNow platform offers several standard applications, such as Incident, Problem, and Change. Administrators can also develop and manage custom applications to meet business needs. When building applications on the ServiceNow platform, application developers can take advantage of existing platform features such as security access controls, workflow, reporting, and notifications as well as existing public data such as user and task records. 

For More Info : Wiki Service Now Applications

                      Introduction to Snow Application / Module Creation


                      Snow Create Incident
                      Snow Orchestration & Cloud Provisioning
Business Rule

A business rule is a server-side script that runs when a record is displayed, inserted, updated, or deleted, or when a table is queried. Use business rules to accomplish tasks like automatically changing values in form fields when certain conditions are met, or to create events for email notifications and script actions.

For More Info : Wiki Service Now Business Rule

                      ServiceNow Express Core Application Configuration | Business Rules
                      ServiceNow Business Rule Introduction
                      ServiceNow Sample Business Rule
                      ServiceNow Business Rules Best Practices Part 1
                      ServiceNow Business Rules Best Practices Part 2

Service Catalog
The Service Catalog application is a way for customers to order pre-defined, bundled goods and services from your IT organization or other departments. It offers a consistent and intuitive online ordering experience with as much flexibility as you need. The catalog is a structured commodity with its own description, fields, price, and execution schedule.
For More Info : Wiki Service Catalog
                     How to setup Service Catalog
                     Service Catalog

Jelly Scripting

Apache Jelly is a Java and XML based scripting and processing engine for turning XML into executable code.[1] Jelly is a component of Apache Commons.

Fir More Info : Apache Jelly

                      ServiceNow Jelly Scripting Part 1
                      ServiceNow Jelly Scripting Part 2
                      ServiceNow Jelly Scripting Part 3

                      ServiceNow Server-Side Scripting Fundamentals
                      ServiceNow Client-Side Scripting Fundamentals

Script Includes

Create script includes to store JavaScript functions and classes for use by server scripts. Each script include defines either an object class or a function. Script includes run only when called by a server script.

For More Info : Wiki Service Now Script Includes

                      ServiceNow Script Includes Introduction
                      ServiceNow Script Includes
UI Actions

UI actions add buttons, links, and context menu items on forms and lists, making the UI more interactive, customizable, and specific to user activities. UI actions can contain scripts that define custom functionality.

For More Info : WIKI ServiceNow UI Actions
                      ServiceNow UI Actions

UI Policies

UI policies are client-side logic that governs field behavior and visibility on forms.

ServiceNow automatically generates client-side Javascript that the browser executes to enforce policies on the form being displayed. Each policy has a condition that must resolve as true to be executed. Policies determine the following field attributes and behaviors:

         Make the field mandatory
         Show or hide the field
        Make the field read-only
Most basic UI policies are declarative and do not require scripting. You may also write your own scripts to handle more complex scenarios.
                                          ServiceNow Express Core Application Configuration | UI Policies
SLA

A Service Level Agreement, or SLA, is a record which defines a set amount of time for a task to reach a certain condition. If the task does not reach the condition by a set amount of time, it is marked Breached.

SLAs are used to ensure that a task reaches end conditions within a certain amount of time, such as ensuring that an incident is closed or resolved within a few business days. The success rate can be reported on, and actions can be triggered at different times during the SLA's life-cycle (for example, notifying the manager when the SLA reaches 75% of its allotted time.)

For More Info : WIKI ServiceNow SLA
                          SLA

Service Now CMDB

                          Service Now CMDB             


Overview of Application Scopes

Each application has an application scope that determines which of its resources are available to other parts of the system. Application scoping ensures that one application does not impact another application. You can specify what parts of the application other applications can access by setting application access settings.

Using REST API, You can perform
                    Retrieve Records from Table (GET)
                    Create a Record(POST)
                    Retrieve a record(GET)
                    Modify a Record(PUT)
                    Delete a record(DELETE)
                    Update a record(PATCH)

For More Info : WIKI ServiceNow Application Scope

                      ServiceNow Application Scopes

Overview of REST API Explorer in Service Now

REST (REpresentational State Transfer) is a simple stateless architecture that generally runs over HTTPS/TLS. The REST style emphasizes that interactions between clients and services are enhanced by having a limited number of operations. Flexibility is provided by assigning resources their own unique universal resource indicators (URIs). Because each operation (GET, POST, PUT, and DELETE) has a specific meaning, REST avoids ambiguity.

For More Info : Wiki ServiceNow REST API Explorer

                        ServiceNow RestAPI Explorer

                      ServiceNow User Interface Design
                      ServiceNow Import Data
                      ServiceNow Conditional Workflows
                      ServiceNow Creating Custom UI Applications

Web Services

HTTP-based web services allow diverse applications to talk to each other. ServiceNow supports both inbound (provider) and outbound (consumer) web services. Glide Record - Special Java class,this can be used in Java script.
For More Info : Wiki ServiceNow Web Services

                      Snow Webservice Introduction
                      Snow Webservice Testing using SOAP

Mid Server

The Management, Instrumentation, and Discovery (MID) Server is a Java application that runs as a Windows service or UNIX daemon. The MID Server facilitates communication and movement of data between the ServiceNow platform and external applications, data sources, and services.

For More Info : WIKI - MID Server
                        Webniar - How to setup Mid Server
                         How to setup Second Mid Server in Service Now
                        How to troubleshoot Mid Server

 - It is always best practice to have two mid servers configured in PROD environment and create a cluster using those two mid servers for load balancing/fail over capabilities.
- It is always best practice to create a separate user a/c and associate to "mid_server" role and use this user a/c to connect to service now instance in Mid Server configuration.
 - Use a user account with full read and write access on agent folder whenever Mid server installed on Windows machine
 - If more than one mid server installed on your windows machine, always give different names to each mid server , you can override wrapper_override. conf file and give distinct names.
- Always refer to log files in windows machine in agent folder to troubleshoot any issues.
- Make sure to check synatx errors if you manually make any changes to config.xml in agent folder, this may cause not to start Mid server.
- Use any of the below three network tools to troubleshoot network related issues with the Mid server
              -> Ping
              -> Traceroute
              -> telnet

Customer Service Management (CSM)


Getting Started with ServiceNow Customer Service Management

ServiceNow Customer Service Management - Setting up company profile and departments

CSM Feature Set

Account & Contract Management.
Product & Asset Management
Warranty & Contract Management.
Case Management
- Case creation through various channels
- Case assignment and Routing
- Case Escalation and SLA
- Entitlement Verification
- Case Resolution
Knwoledge  Base Management


Discovery

The ServiceNow Discovery application finds computers and other devices connected to an enterprise's network. When Discovery finds a computer or device, it explores the device's configuration,
provisioning, and current status and updates the CMDB accordingly. On computer systems, Discovery also identifies the software that is running and any TCP connections between computer systems.
Discovery creates all the relationships between computer systems (such as an application on one server that uses a database on another server).


- Discovery Phase - Identify whether any devices are active and alive  - Shazzam Probe
- Classification Phase - Classification Probe
      - Failures may occur if there is any network connectivity or incorrect login credentials
- Identification Phase
      - Failure may occur if  there are multiple items found for the same device
- Explortion Phase
      - Possible failures - No space on device, no sudo permissions
- Port 22 used for SSH
- Port 161 used for SNMP
- Make sure you give correct IP range, otherwise there might be failure occur during scanning phase.
- Active = 0 and Alive = 0 means, nothing discovered.
- Active =0 and Alive =1 means, there is a device but not accessible for discovery.

Port probes are used in Discovery by the Shazzam probe to detect protocol activity on open ports on devices it encounters


Probes are launched by the MID Server to collect information about a device

       For More Info :  WIKI Discovery
                                  Discovery Introduction
                                  Phases in Discovery Phase
                                  Discovery Troubleshooting in Scanning Phase
                                  Troubleshooting Discovery in Classification Phase
                                  Troubleshooting Discovery in Identification Phase
                                  Troubleshooting Discovery in Exploration Phase
                                  Discover your world - Credentials, CMDB and MID servers
                                  Discovery, MID Server, CMDB, Automation, SCCM
                                  www.youtube.com/watch?v=T8jLoQd_iTk
                                  How to Resolve Probes and Sensors conflicts

dscy_credentials_affinity.list - This will give you all the credentials affinities
Right click on any CI header -> show XML - display all the relevant information about the selected CI
Right click on any CI Header -> History - this gives you history of the CI when it got created and what are all the changes made to this CI
Select CI -> Discovery Events - Gives you history of the all the events happen on the CI
- Make sure 'Cache results' check box is always selected for all the custom probes in order to minimize the performance, For eg : If there is no change in CPU from last run to current run, no need to execute the probe .

- Discovery Process flow outlined in below diagram


Best Practices for CMDB and Discovery Implementation

-          Keep Production and Non Production MID Servers separated
-          Use easily distinguishable folder names for separate MID Servers on the same host.
-          Evaluate MID Server resources to determine whether to deploy multiple MID Servers on the same host or not
-          Avoid copying and pasting a config.xml file from the folder of a previously installed MID Server
-          Modify each config.xml with respect to each Mid server manually as per the target Service Now Instance
-          Leave always mid_sys_id value blank in config.xml
-          Configure Service Now Instance URL, User Name, Password , Mid Server Name, Mid Server Display name manually by editing config.xml, Make sure to always set ‘encrypt’ value to ‘true’
-          The Wrapper name and display name of each Mid server service must be unique ( Agent  -> Conf -> wrapper-override.conf)

-          Enable Clustering Multiple Mid servers in PROD environment for load balancing and failover protection (Mid Server -> Capabilities -> Shuffle the Mid Server to right hand side) - Do same for another MID Server which need to be clustered.

Dependent on the need, clusters are best used to help support large discovery tasks that need to be completed in a shorter amount of time.


-          Make sure there are no firewalls are blocking communication b/w server and instance.
-          Select the Mid Server -> Configuration Parameters -> New -> Make sure ‘mid.use_powershell’ value should be true

-          Avoid running more than one Discovery schedule same time

- Discovery Configuration Console allows you to configure Ignore device list that you don't want to discover.. Best way to avoid discovering unwanted CI's

- Use ' Discovery Behavior' for more advanced and effective scanning CI's in Discovery schedule, Not only you can choose more than one Mid server, but also you can customize what port probes that you want to scan as well. For eg : If you run quick discovery, by default it will scan for all  port probes such as http,slp, wins, dns, ssh, wmi, snmp, etc..With Behavior feature, you can customize and specify port probes only which you want to scan, For eg : If you are not interested to scan Network devices, then you can remove SNMP port probes in your schedule.

- How to check whether WMI Access is enabled on target Windows server or not ?
Answer : Issue below command in the windows machine where MID Server is running
wmic /node:"10.0.0.1" /user:"domain\user" /password:"password" path win32_operatingsystem

The Benefits of good "Behavior" while Performing Discovery Scans

A Schedule can utilize a behavior
Behaviors contain functionalities
Functionalities contain functionality definitions
Functionality definitions are containers of port probes
Port Probes are derived from IP Services


- It is an absolute best practice not to mix MIDServers in either a Load Balance or Fail Over cluster that do not have the same capabilities.  Only have clusters of the same type of MIDServer (Windows/Unix).

- It is very strongly suggested that any changes or updates you want to make to “factory” queries that you duplicate said probe/sensor copying the configuration to a custom name then making your updates.  This way you ensure that any changes to the default ServiceNow Discovery probes will be updated for later review of capabilities that can be added to your customizations.  It is also valuable to utilize update sets so that development work can transferred easily across instances.

- A good practice is to identify the type of information coming back and if it is going to be used across all Operating systems for the type(s) of devices before you make any changes to out of box probes/sensors

- If you customize any probe/sensor, make sure Major and Minor version of probe exactly match with the corresponding Sensor Major and Minor versions

Asset Management


                                  Asset Management Introduction

alm_item.list
alm_hardware.list

Microsoft SCCM Integration

                                      Microsoft SCCM Integration 3.0
                                      ServiceNow: SCCM Integration Training
                                              Microsoft SMS/SCCM integration 2.0




There are multiple ways we can discover Windows Servers, One is Service Now Discovery will discover all windows servers based on configured schedule, Second way is, If any organiazation already have SCCM in place to  monitor all the windows servers, then Service Now can activate SCCM Plugin and talks to SCCM and loads the CI's into CMDB table, Discovery no need to talk to each Windows server again in the network. This will avoid scanning of same windows server again.

What is SCCM ?

System Center Configuration Manager (SCCM)
System Management Server(SMS)

SCCM manage large groups of windows computer systems ( remote control/patch management, s/w distribution, os deployment, hardware/s/w inventory)

                        Microsoft SCCM Integration 3.0

Why we need SCCM ?
- Query each SCCM table directly from SNOW and place data into CMDB

- By default, this plugin not active, you have to manually activate this plugin
- SCCM Populates a flat transition table in SQL server on periodical basis, Service Now Imports from the SQL Server transition table into CMDB
- If Discovery of same CI doesn't create duplicate CI's in CMDB
- Removal of s/w packages i SCCM servers imported relationships of that s/w in CMDB




Service Catalogs in ServiceNow

The Service Catalog application is a way for customers to order pre-defined, bundled goods and services from your IT organization or other departments. It offers a consistent and intuitive online ordering experience with as much flexibility as you need. The catalog is a structured commodity with its own description, fields, price, and execution schedule.
 Types of Service Catalog : Record Producer, Order Guide, Normal Catalog Item.



Execution Plan

An execution plan describes how a catalog item is procured, configured, and installed. Each execution plan contains one or more tasks.
For example, an organization might create an execution plan for delivering a corporate standard PC that contains these tasks:
Procure the PC from a supplier.
Configure the PC according to the requester's specifications.
Deliver the PC to the requester.
An execution plan is not specific to any one catalog item. There could be many different models of PC that a user can order, all using the same execution plan. It is usually not necessary to create a new execution plan for each individual catalog item in a mature service catalog.


Note Note: Execution plans are not as powerful or flexible as workflows, and cannot be designed using a graphical editor. Execution plans are useful in some circumstances (for example, if you need to build your processes programmatically or through imports), but ServiceNow typically recommends using workflows for request fulfillment processes.


For More Info : WIKI ServiceNow Service Catalog
                         Webinar - Introduction to Service Now Service Catalog & Workflow
                        WIKI Service Now - Execution Plan
                        Webinar - Service Now Catalog Item & Execution Plan
                        Webinar - Service Now - Conditional Workflow

Service Catalog Order Guide

Order guides allow customers to make a single service catalog request that generates several items.
For example, a New Employee Hire order guide could contain several items that new employees commonly need, such as business cards, computer, and cell phone. After selecting this order guide, the customer can then provide information about the new employee, including location and job title. The order guide then submits an order for catalog items like business cards, based on the details provided.
Order guides determine which catalog items to order by evaluating order guide rule conditions. Information the customer enters within the order guide can be passed as cascading variables to the ordered items, allowing common information to be reused across multiple items.

Administrators and catalog administrators can create order guides for the service catalog.

Order guides can be run automatically, generating a set of ordered items without needing to manually submit a service catalog request. For example, an onboarding workflow for a new employee can automatically run an order guide to order items for that employee. This feature is available starting with the Eureka release

For More Info : WIKI Service Now Order Guide
                          Webinar - Service Catalog Order Guide

Transformation Map

A transform map is a set of field maps that determine the relationships between fields in an import set and fields in an existing ServiceNow table, such as Incidents [incident] or Users [sys_user]. After creating a transform map, you can reuse it to map data from another import set to the same ServiceNow table.

The Transform Maps module enables an administrator to define destinations for imported data on any ServiceNow tables. Transform mapping can be as simple as a drag and drop operation to specify linking between source fields on an import set table and destination fields on any ServiceNow table. Use transform mapping to map source and destination fields dynamically.

                         Creating New Transform Maps



Import Sets

Import Sets is a powerful tool used to import data from various data sources, and then map that data into ServiceNow tables. The Import Sets table acts as a staging area for records imported from a data source.
For More Info :  WIKI ServiceNow Import Sets

                       Integration Best Practices - Import Sets

How to Use Background Script in SNOW?
                      Background Scripts

How to get CSV/WSDL/XML from any Table in Service Now ?

Answer :  Service Now Instance URL / <Table Name>.do?CSV - For CSV file
                Service Now Instance URL / <Table Name>.do?XML - For XML file
                Service Now Instance URL / <Table Name>.do?WSDL - For WSDLfile
Example : https://demo005.service-now.com/incident.do?CSV

How to open  Java Script Executor
Answer : Ctr + Shift + Alt + J - Press this key on any form

How do you Impersonate User in Service Now ?
Answer : Click on 'Administrator Icon' , Enter the User Name and click on 'Ok

- How to Edit Application and Modules
Answer :  Search for the application which you want to Edit, Right click on the application, choose ' Edit Application Menu, This will display all the modules in the applications, you can verify the table name, roles associated at application level and module level.

- How to find the sys_id of a specific object in service now ? For eg : I want to know the sys_id of 'Create New' Module in 'Change' Application
Answer : Search for 'Change' Application, Edit , Right click on the Module which you want to find the sys_id,, choose 'Copy sys_id' field, this will display you the corresponding sys_id of selected module/application/workflow/table/etc..

- Shortcut to see contents of the table
Answer : Type <table_Name>.list : For eg : 'change_request.list'  in Search Menu

- How to find out a table for a specific form ?
Answer : Launch the form, Right click on top header section, choose Personalize -> Table, This will list out the table name and all the existing columns in a table.


- How to see and modify the Work flow?
Answer : Search for 'Workflow Editor' ->  Choose 'Open' Menu ->  Search for the work flow that you want to open, and select it ->  If it is already published, then choose 'Check out' from the 'Gear' Menu -> Modify the work flow, and publish finally.

- How to see the existing Events logs?
Answer : Search for 'Events' -> Select 'Events' Module under 'System Logs'

- How to see existing events defined in service now?
Answer : Search for 'Events' -> System Policy -> Registry 

- How to See Approvers tab when a catalog item is requested ?
Answer : Once the catalog item order is submitted,  You should see a message 'Thank you , your request has been Submitted' , click on the 'Description Link'  -> Right click on  Request Item page -> View -> Default -> You will see approver tab, if you belongs to approver group.

- How to see the WSDL for any table ?
Answer : <host name>/tablename.do?wsdl
            Example : https://dev15439.service-now.com/incident.do?wsdl

- How to trigger an event using script?
Answer : gs.eventQueue('change.release.window.rejected', current, gs.getUserID(), current.number);

- How to see all the existing work flows ? and belongs to which table ? etc . ?
Answer : Search for 'Workflow Versions', You can filter by work flow name, table name etc..

- How to add log messages and view them in Service Now ?
Answer :  Below are all the possible ways how we can log specific message

  • current.field_name.setError("Hello World"); Will put "Hello World" below the specified field
  • gs.addInfoMessage("Hello World"); Will put "Hello World" on the top of the screen
  • gs.print("Hello World"); Will write to the text log on the file system but not to the sys_log table in the database
  • gs.log("Hello World"); Will write to the database and the log file. Too much of this can adversely affect performance
To view - System Log -> All , It will show all the log messages  

How to Delete all the records in a specific table and associated all referenced tables?
If you have a requirement to delete all the records from a specific table and associated reference tables
 - Goto Tables and Columns
 - Select the table name you want to delete all the records
 - Bottom side, you will see all the referenced tables associated to the selected table
 - Click on 'Delete All Records' button. this will delete all the data.

How to increase Duration of UI Transaction in Service Now ?
Answer :  https://<<Company>>.service-now.com/nav_to.do?uri=%2Fsysrule_quota.do, Modify the value of Maximum Duration (seconds) value , By default this value is 290 seconds.
Or
- Look for below table data sysrule_quota.list, and filter 'Name' by 'UI Transaction' and edit the record

How to see the Pach and version related info in SNOW?
Type 'Stats' in application navigator How to appear for certification

How to see the history of Transform Maps?
Answer : Search for 'Transform History' , Identify the 'Transform Map' in results and you will see corresponding Import Set and etc..

How to compare whether any String Contains other String ?
Answer : Use 'indexOf("Search") > -1  

Eg : if(this.rec.u_service.indexOf("SAM") > -1 && this.rec.u_subtype == ""){
    allowed = true;

}

- How to Perform 'Null' or 'blank' check on a specific field  
var secondQuery = new GlideRecord('cmdb_ci_computer');
// Query CMDB Computer table with the store ID and find out computers whose Store ID is blank
secondQuery.addQuery('name','CONTAINS',splitName);
        // Check if 'u_store' field value is null or blank
secondQuery.addNullQuery('u_store');

secondQuery.query();

How to Query Users based on specific Role ?
var firstQuery = new GlideRecord('sys_user');
var encodedString = 'roles=store_user';
encodedString = encodedString + '^user_nameLIKEst';
firstQuery.addEncodedQuery(encodedString);
// This quey returns all user accounts whose name contains 'ST' , that means get all Store user accounts

firstQuery.query();

How to include Date comparisions in Glide Query in Service Now ?

var ci=new GlideRecord('cmdb_ci_netgear');

ci.addEncodedQuery('sys_created_onNOTON2016-09-14@javascript:gs.dateGenerate(\'2016-09-14\',\'start\')@javascript:gs.dateGenerate(\'2016-09-14\',\'end\')^sys_class_name=cmdb_ci_netgear^u_nameLIKEravi);

ci.query();
while(ci.next()){
gs.print(ci.u_name);


}

// How to set a field required in using script

// Below is the code snippet wrote in UI Action (Client Side) to make a specific field 'Comments' required.

g_form.setMandatory('comments', true);

// How to display an error message at field level ? Wrote below code snippet in UI Action to display 'comments' field mandatory information in red color just below the 'comments' field. "sys_properties.list' stores all the key,value pair of messages.

g_form.showFieldMsg('comments', getMessage('Please enter a comment when reopening an Incident'), 'error');

// Display Alert message in client script, Retrieves from 'sys_properties.list' based on key provided below.

 alert( getMessage('Please enter a comment and click on Reopen Incident button'));

// How to include a field value changes in Work Notes section on Incident Form, For eg : I wanted to display Old & New values of 'Hold Reason' field on Incident form whenever updated
 -> Go to Incident Form, click on 'Filter' button right to 'Activity' as shown below


 -> Click on 'Configure available fields' link
-> Select the field that you want to monitor old and new values, shuffle it into right hand side.
-> After every time you modify the specified field on Incident, you should able to see old value and new value as shown above.



Service Now Certification Program
Service Now Certification Registration
https://www.webassessor.com/wa.do?page=publicHome&branding=SERVICE_NOW

Service Now Forum
https://community.servicenow.com/community/knowledge-user-conference/