ServiceNow Server Side Scripting | Tutorial Server Side Scripting ServiceNow

Article briefs about ServiceNow server side script or ServiceNow server side programming. This ServiceNow tutorial Provides you complete understanding that in which section we can write server side code in ServiceNow. Will also provide brief of all those sections which will helps you to understand the required concepts in detail.

server side programming servicenow,servicenow server side scripts,server side scripts in servicenow

In this ServiceNow tutorial you will get the brief of ServiceNow server side scripts. When the requirement comes to coding then client side scripting, server side scripting, front end code, back end code comes into picture right. So here in this article, we will discuss about server side scripting or server side programming in ServiceNow and below are the topics which we will discuss in this article.
  • What is server side scripting or programming in ServiceNow?
  • From where we can test our server side script in ServiceNow?
  • Name some scripting options or area, which is used for server side scripting or programming in ServiceNow?
So Let's start...

ServiceNow Server Side Scripts:

In ServiceNow server side script execute on the server or database. Using server side scripts, we can perform many actions, some of them are as mentioned below:

  • Database operations such as create record, update record, delete record, display records etc.
  • Update related record based on current record.
  • Sending and receiving request and response while doing integration.
  • Log messages
  • Send email notifications

There are many many of activities which we can perform using server side programming in ServiceNow.

From where, we can test our server side scripts in ServiceNow?

We can test your server side code by using background script. Background Script is just an interface for executing server side logic or java script code at the moment when you click on Run Script button. Below is the screenshot for the same:

Tells about server side programming in servicenow
Server Side Script in ServiceNow-Background Script


Name some scripting areas which is used for server side scripts in servicenow?

In ServiceNow there are lots of options from where we can do server side scripting. Each and every option or area is used to performed specific server side scripting. Such s to add button use UI action, execution of code before value get saved in database use business rule, for reusable functions and class use Script include etc. There are lots of other functionalities too. Below are the scripting areas and a overview of all those areas which is used for server side script in ServiceNow:

Business Rules

The script or code written in business rule area will get executed when record is inserted, displayed, updated, deleted or when table is queried. 
There are four when to run condition such as before, after, async and display which we have select accordingly while doing server side scripting in business rule. 

For e.g. if we want that some code will run before the form is displayed to user then we have to select displayed from when to run condition and write code on that business rule for the same because display business rule executes before the form is presented to the user and  just after the data is read from the database. Below is the screenshot of business rules in ServiceNow. If you need you can also check tutorial video available in ServiceNow Video option in Menu section.

server side script servicenow, server side programming in servicenow, servicenow server side script
ServiceNow Business Rules

To understand Business Rule you can also refer below video link for the same.

Demo of ServiceNow Business Rule Video

Script Include

We can write java script functions and classes in script include. Written java script functions and classes in script include is used by server side scripts such as business rule, script action etc. 

We can call script include function and classes any where while doing server side scripting in ServiceNow. If you need you can also check tutorial video available in ServiceNow Video option in Menu section. Below is the screenshot of script include in ServiceNow:


server side script servicenow, server side programming in servicenow, servicenow server side script
ServiceNow Script Include

To understand ServiceNow Script Include, you can also refer below Video link for the same.

Demo of ServiceNow Script Include Video

UI Action

We can write server side code and client side code or both in UI action scripting area. UI action is widely used in servicenow for server side scripting and client side side scripting. In ServiceNow UI action is used to add button, link, context menu etc in form. Below is the screenshot of UI action in ServiceNow. If you need you can also check tutorial video available in ServiceNow Video option in Menu section.

server side script servicenow, server side programming in servicenow, servicenow server side script
ServiceNow UI Action

To understand ServiceNow UI Action, you can also refer below Video link for the same.

Demo of ServiceNow UI Action Video

Service Portal

Service portal is used to build mobile friendly applications. The coding which we do for service portal is basically we do in widget editor as widget are used to display in service portal page section. 
We will talk about this in detail in another article. In widget editor we can write html, css, client side script, link function and server side script. Below is the screenshot of service portal widget editor.

server side script servicenow, server side programming in servicenow, servicenow server side script
Server Side Script in ServiceNow - ServicePortal

To understand ServiceNow Service Portal, you can also refer below Video link for the same.

Demo of ServiceNow Service Portal Video

Script Action

Script actions are server side script and get triggered by event. As we know that we can trigger event from business rule. For e.g. business rule trigger event --> event trigger script action --> script action script gets executed. Hope you understand. Below is the screenshot of script action in ServiceNow.

server side script servicenow, server side programming in servicenow, servicenow server side script
ServiceNow Script Action

UI Page

UI pages in servicenow can be used to create and display forms, dialogs, lists and other UI components. In UI pages we can write client-side script and service side script both.Below is the screenshot of UI Page in ServiceNow.

server side script servicenow, server side programming in servicenow, servicenow server side script
ServiceNow UI Page

UI Macro

UI macro executes on the server side. It may contain both server side code as well as client side code. Below is the screenshot of UI Macro in ServiceNow.

server side script servicenow, server side programming in servicenow, servicenow server side script
ServiceNow UI Macro

To understand ServiceNow Service Portal, you can also refer below Video link for the same.

Demo of ServiceNow UI Macro Video

Reference Qualifier

Reference qualifier is ServiceNow we actually used in reference field (for e.g. assigned to, assignment group, requester etc. in incident form) to create filter to get only required data from the reference table selected in reference field. 
There are different types of reference qualifiers such as simple, dynamic and advance, we will talk about these in details in another article. Below is the screenshot of reference qualifier:

server side script servicenow, server side programming in servicenow, servicenow server side script
Server Side Script in ServiceNow - Reference Qualifier


To understand ServiceNow Reference Qualifier, you can also refer below Video link for the same.

Demo of ServiceNow Reference Qualifier Video

Workflow Scripting

There is an activity in workflow name as Run Script. We write code on run script section accordingly as per workflow requirement.

Transform Map Scripts

As we know that we write transform script when we do import and export of data in ServiceNow platform. Transform map scripts in ServiceNow allows us to customize import operations. There are two types of transform scripts such as explicit transform map scripts and transformation event scripts.

We hope above information related to ServiceNow server side scripts will be useful for you. You can also find video tutorial for the same in our YouTube channel Basico ServiceNow Learning. We have posted video of server side scripting in ServiceNow along with other required topics. Please provide you feedback in below comment and let us know if you have any query or you need more information in Server Side programming in ServiceNow.

2 comments:

Thankyou !!!!

Powered by Blogger.