LogiUpSkill

Automated Test Framework(ATF) in Service-now

Automated Test Framework (ATF)     With the Automated Test Framework (ATF), we can create and run automated tests on our Service Now instance.              Whenever we upgrade to any instance, we can run these tests to confirm that the instance still works as designed.              To enable test execution –>select Properties of ATF application–>select the yes option to enable test/test suite execution.                createnew test case, search for test module in left navigation -> Click on  New                New form will be open as follows-                To add test step – >Click on Add Test step                Step 1 – Select create a user option                Specify user details like first name, last name, roleetc and impersonate this user, so test case will be run as newly created user.                  Step 2- To check the mandatory fields, need to open an existing record first-                Select table name and record                Step 3 – Select field state validation option                Select table name, Visible, Read only, mandatory etc options-àSave                Now run the test case                Test result-                If every step works as per expectation then you can see following successful test status.                Test case evidence are also collected, we can see them from test result, open latest record                See the attachments; at every step one test evidence is getting captured.

Incident Management

Incident Process in Service-now What is Incident? Incident is an event of interruption or disruption or degradation in service operation. An open incident implies that the customer is impacted. Goal of incident management The first goal of the incident management process is to restore a normal service operation as quickly as possible and to minimize the impact onbusiness operations, thus ensuring that the best possible levels of service quality and availability are maintained. ‘Normal service operation’is defined here as service peration within Service Level Agreement (SLA). Different ways to raise Incident: User can open Incident Ticket via User Interface (Self Service) or Email. IT ServiceDesk will open an Incident for all incidents reported via phone, walk-in or Email. Incident Tickets can be opened automatically by monitoring tool. The monitoring team will also create incident for qualified alert. 1.Creating Incident via User Interface (Self Service): In Service Now personal development instance in left navigator search for Incident. Go to Self Service> Incident> New Click New it will open Incident Form here in short description end user should write issue faced and define Urgency and Submit form. 2.Creating Incident via Email: If user don’t have access to the service now or user unable to login to the system in that case incident can be raised by sending mail to ServiceNow,only if the user is specific or having specific mail id. As per the mail, record get inserted in incident table, for this customization is needed that willbe done in Service Now, System Policy> Email> Inbound Actions. 3.Creating Incident using Service Catalog: In ServiceNow personal development instance in left navigation search for catalog Self Service> Service Catalog> Can We Help You?> Create Incident Enter the issue in Please describe your issue and define Urgency. Click on submit and see incident created as below 4.Creating Incident using Service Portal: In Service Portal Home click on Get Help> Create Incident> Submit Fill urgency and issue click Submit Incident created as below All incidents are shown in service portals homepage in My Open Incidents 5.User can create incident by contacting to IT Service Desk via Phone or walk-in and as per information given by user/customer/caller/requesterIT Service Desk will create incident in ServiceNow, Incident> Create New. Once the incident is logged in into the system now IT service desk agent will work on it. For that in left navigation search for incidents go to Incidents>open-unassigned It will check the incidents are not assigned, now open the incident from list as per the short description categorization of incident is takes place thenas per urgency defined by caller incidents priority is set. Then as per the category and priority of incident, incidents are assigned to Assignment groupor to a particular member in that group I.e. Assigned to Now the assignee will work on that incident to fix the issue/interruption. Example: Incident is raised by end user via self- service contact type now see incident life cycle to fix issue as follows Saanvi is end user she faced an issue that she unable to open email so she has created incident via self-service as follows (for this I impersonateuser as Saanvi ) What is impersonation? Administrators can impersonate other authenticated users for testing purposes and view impersonation logs. The impersonation option is not visiblein the mobile view of the platform. When impersonating another user, the administrator has access to exactly what that user can access in the system, including the same menusand modules. The instance records anything the administrator does while impersonating another user as having been done by that user. Procedure to Impersonate user: In the banner frame, click your user name to open the user menu. Select Impersonate User. The Impersonate User dialog box appears. Select a user from the Recent Impersonationslist or enter a different user’s name in the user selection field. To return to your original login, follow these same steps then select End Impersonation. Here I impersonate user as Saanvi Saanvi has created incident via self-service as follows Now I Priyanka system administrator checked un assigned incidents for that go to Incidents> open-unassigned To check the incident raised by Saanvi, I will add filter condition in list view as follows Click on filter icon add condition caller is Saanvi then click Run Or in search field find caller Saanvi Then press Enter it will shows incidents where caller is Saanvi/ incidents raised by Saanvi Open the incident now I will work on that incident to resolve it. As per short description I set category and subcategory of incident. According to urgency and impact incidents Priority is set. In contact type I entered self servicecause incident is raised via Self service. I entered Assignment group and Assigned to values as below. Once incident is assigned State of incident changes to In Progress. Now assignee will work on that incident and if needs more information from caller or any other reason he can keep this On Hold. For this click On Hold now on hold reason is mandatory save the form it shows Resume UI Action, once information is taken from caller assigneewill resume work by clicking on Resume. Click on Resume state of incident changes from On Hold to In Progress Now after solving issue assignee will click on Resolve and state changes to resolved. After this assignee click on Close Incident to close the incident and state changes to closed In this way incident get resolved and then closed. The process flow will be like In this example On Hold, Resume, Resolve and Close Incident UI Actions/buttons are custom UI Actions. UI Actions: Here following are the custom UI Actions that I have created and as per UI Action incident state changes as follows Incident Process in Service-Now We have incident where we have following process. We have following state for incident.1.New2.In Progress3.Pending Customer4.Pending Information5.Customer Update5.Resolved6.Closed Incident Process till Close1.New created incident in New State2.Fulfiller should ACK the ticket by clicking on ACK ui action and incident should go in “In Progress” state.3.Fullfiller can change the state to Pending

Datalookup in Service-now

Datalookup in Service-now Data LookUp : This is the rule table that defines the rules that automatically set one or more field values when certain conditions are met. (At client side) For example , in the Incident table we can set the value of “Assigned to” field depending on the combination of “Category” and “SubCategory” fields. Say , if “Category” is “Hardware” and “Subcategory” is “Keyboard” then Set “Assigned to” as “John”   Problem Statement : Set the values for Address and User according to Name . Create Data Lookup Table : Create a new table as a data lookup table.   To create data lookup table,it must extend the Data Lookup Matcher Rules [dl_matcher]        table, as shown in below snapshot,  Save the above table. Create the same fields as in the Source table (table for which this data lookup table is created) for which we want to set the rule.  As per the problem statement,  Create fields: Name,Address and User in “Demo Rule Table”.      Save above changes. Now Open the Demo Rule table (Data lookup table) and set the values for the fields as below, Set all the values that we required,(see the list below), Create Data Lookup Rules:   Now map the data lookup table and Source table. For that follow the following steps, Navigate to Data Lookup Definitions and Click on New Button.  Click on Data Lookup Rule. The following form will be displayed, Write Source table On which we want to apply the rule and Matcher Table in which we have created fields on which we have to set the Rule, Check checkboxes, Active : (run on client side) Select this check box to run this data lookup rule. Clear the check box to ignore this data lookup rule.   Run on Form change : (run on client side) Select this check box to automatically look up values whenever a user or onChange client script changes a field value on a source table form.   Run on insert : (run on server side) Select this check box to automatically look up values whenever a user creates a new record.   Run on update : (run on server side) Select this check box to automatically look up values whenever a user saves or updates a record.   Save this Form. Open the saved  Data Lookup Definitions , At the bottom, Click on “Matcher Field Definitions ” tab and Click on New button, following form will be displayed. Map the Source table and Matcher table(Data lookup table) fields as shown in above snapshot, Check the “Exact  lookup match “ checkbox if you want to make it case sensitive. Save the above changes. Now Click on “Setter Field Definitions” and Click on New Button as shown in below snapshot, Map the fields that we want to set the values depending on the Matcher Field Definitions as below, Set all the fields, Now Open the new form for the source table. Type Name as “Ashwini” . The fields “Address” and “User” will be automatically populated as “Pune” and “Ashwini More” respectively. See below snapshot, But if we change Name to another name , Say Sonia the Address and User values does not change. (see below snapshot) Because in Data Lookup Definitions, In Setter field Definitions , we have set the Always Replace value to false. Set the value of “Always Replace“ as “true” for all fields.(See below snapshot) Save above changes and check again in the source table.

Inbound Email Action in Servicenow

Inbound Email Action in Servicenow INBOUND EMAIL ACTION SCRIPTING   Requirement: Creating incidents for every single email attachment through inbound action.    Components Used: Inbound Action on Incident Table ‘sys_email_attachment’ Table ‘sys_attachment’ Table    Script for Inbound Email Action: (function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {                 // Implement email action here               var emailSysId = sys_email.getUniqueValue(); // sys_id of email log record var qq=”email=”+emailSysId; //query to fire on sys_email_attachment table       var i=0;   gs.log(“Email sys_id is: ” + emailSysId, “EMAILSCRIPT”);                   var   gr = new GlideRecord(‘sys_email_attachment’);           gr.addEncodedQuery(qq);           gr.orderByDesc(‘sys_created_on’);           gr.query();           while(gr.next()){                                                          var gr1=new GlideRecord(“incident”);                                             gr1.short_description=”Attachment number”+i;  //Hardcoded short description                                             var t=gr1.insert();                                              i++;                                    var attachment = new GlideRecord(‘sys_attachment’);                              attachment.get(gr.attachment);                              attachment.table_name =”incident”;                              attachment.table_sys_id = t;                              attachment.update();          }   })(current, event, email, logger, classifier);

Domain Separation In Service-now

Domain Separation In Service-now  1. MSP –Managed Service Providers  2. It is a paid plugin, user needs a Maint Role to activate the plugin in your instance.  3. It is a logically defined entity used to             1. Separate Data             2. Separate Process             3. Administrative Tasks   4. MSP deals with which user can see and access what data   5. By structure Service now has a Single Tenant Architecture but by using MSP plugin it can be used as Multi-Tenant Architecture   6. Multi-Tenant: It is a structure of application where single instance of the application serves multiple customers by sharing the application properties and a single database.   7. Service now with MSP Plugin:                1. Service now with MSP  Plugin acts as a Multi-Tenant architecture where single instance serves multiple customers using single database.                2. Each customer data is isolated and remains invisible to other customers.   8. When we should not go with MSP Plugins-              1. In case of total separation of all system properties              2. Does not require the global reporting              3. Does not require a single global processes   9. System will not support the following tables from being domain Separated                Access Control [sys_security_acl]                Script Includes [sys_script_include]                System Property [sys_properties]                Dictionary Entry [sys_dictionary]               Dictionary Entry Override [sys_dictionary_override]  10. Domain Scope:        Domain scope defines what users can(data) and cannot access(data) and how(Process).             1. Session Scope Domain             2. Record Scope Domain             1. Session Scope Domain:                           a. User Domain                             b. User domain Picker Domain                          Session domain of users is nothing but the user record domain if we have the user domain and the domain picket domain is the same in case of not,                                       session domain is the same like the domain which use has selected from domain picker.                         Users from parent domain they can change their session domain by changing from Domain picker.   2. Record Scope Domain:               a. It is nothing but the domain of that targeted record.               By Default the record scope take precedence over the session scope   11. We have following domains which has some special meanings.                Global Domain:               a. All the records which we have before enabling the MSP plugin, are part of global domain.               b. Guest user is a part of global.  Default Domain:                a. We can set any domain as a default domain but only one can be a default domain.                b. If you set default domain in an instance, instance will replace the global domain with default domain whenever the record creation happens. Primary Domain:              a. Only the domain which does not have parent can be set as primary domain.

Table Names in Service-now

Table Names in Service-now Users – sys_user Roles – sys_user_role Group – sys_user_group Contains Roles – sys_user_role_contains UserRole mapping – sys_user_has_role GroupMember – sys_user_grmember Application menu – sys_app_application Modules – sys_app_module Choice – sys_choice Business Rules – sys_script UI Actions – sys_ui_action Client Script – sys_script_client Plugins – v_plugins Syntax Editor macros – syntax_editor_macro Dictionary Entries – sys_dictionary Tables – sys_db_object Remote Instance – sys_update_set_source Retrieved Update Sets – sys_remote_update_set Update Set Log – sys_update_set_log Local Update Set – sys_update_set Incident – incident Task – task Problem – problem Change request – change_request Field Classes – sys_glide_object Form Sections or Layouts  – sys_ui_section Views – sys_ui_view Dictionary Entry Override – sys_dictionary_override Request – sc_request Catalog Item – sc_cat_item Requested Item – sc_req_item Catalog Task – sc_task

View Rule

View Rule This rule determines how a record is presented to the user by dynamically selecting the appropriate view based on defined conditions. Instead of showing the same layout to everyone, it intelligently adapts the form view according to factors such as user role, record state, or field values.  By doing so, it ensures that:  Users see only the most relevant fields  The interface remains clean, focused, and role-specific  Data entry becomes faster and less error-prone  Overall user experience is more intuitive and efficient  In short, this rule acts as a smart filter for the UI, displaying the right view at the right time to the right user—enhancing clarity, productivity, and usability.  To create a view, go to Configure → All → View Rules and click New.  A form will open where you define conditions to control which view is shown. Based on these conditions, the system automatically displays the most relevant view, ensuring a clean and user-friendly interface.  Save the form to apply the configuration.  Once saved, the View Rule is created and stored as shown below, ready to dynamically control which view is displayed based on the defined conditions.  Now, based on the conditions defined in the View Rule, open any Incident record where the Caller is Mac Marksberry.  When you open this record, the system will automatically apply the rule and display the configured view for that condition.  As per the configured View Rule, the record will now be displayed in the ESS (Self-Service) View.  This means the Incident opens in the Self-Service View, showing only the relevant fields intended for end users, as illustrated below.  We can also create a View Rule using a script by enabling the Advanced checkbox.  This allows you to apply custom scripted logic to determine the view dynamically, offering greater flexibility for complex conditions beyond the standard configuration. 

Data Policy

Data Policy Definition: A Data Policy is a server-side rule that enforces data consistency and integrity by setting fields to mandatory or read-only based on specified conditions. It applies to all data entry methods, ensuring rules are followed regardless of how records are created or updated. Web services/APIs Import sets Email integrations Mobile UI Scripted updates Steps to create Data Policy: Navigate to the Application Menu, search for Data Policies, and select Data Policies under the System Policy After clicking this, we are redirected to the form shown below, where the next set of configurations can be performed. Here is short description about checkboxes that are present on the Data Policy form: Use as UI Policy on client – Applies the Data Policy on the client side like a UI Policy, without writing scripts. InheritWhen enabled, this UI Policy is inherited by child tables of the current table. If unchecked, the policy applies only to the current table. Reverse if falseAutomatically reverses the UI Policy actions when the condition becomes false. This ensures fields return to their original state without needing extra logic. Apply to import setsApplies the UI Policy during data imports via Import Sets. Useful when you want the same rules enforced on imported records. Apply to SOAPEnsures the UI Policy is applied when records are created or updated through SOAP web services. Example: When Data Policy is applied to a field, it is enforced even during data imports from external sources. While importing data, the system checks whether a Data Policy exists on the target table and field. If the imported value violates the policy (for example, a mandatory field is left empty), the record will not be inserted or updated.This ensures data consistency and validation, regardless of whether the data is entered manually or imported. To implement this requirement, we create a table called User Details. In this example, we apply Data Policy on a field to enforce validation, as shown in the screenshot above. In the next step, we import anonymous data from an external source like Excel to validate the applied Data Policy. Navigate to the Application Menu and search for Load Data to begin the import process. Select the Create Table option, then click Choose File to upload the source file. Once the data file upload is complete, this page appears to continue the import process This means your data has been uploaded and is ready for the next step. We attempted to upload 10 records from the Excel file; however, only 8 records were successfully uploaded due to validation rules. This happens because of the applied Data Policy. The Data Policy is enforced on the Mother Name field, and in the imported data, the last two rows don’t have values for this field. As a result, those records fail to the Data Policy validation and are not imported, while the remaining records are successfully accepted.

JavaScript Overview

JavaScript Overview JavaScript Output: We have the following ways to display output in JavaScript: innerHTML – displays data inside an HTML element <p id=”demo”></p> <script> document.getElementById(“demo”).innerHTML = 1 + 0; </script>   document.write() – mostly used for testing document.write(“Pavan”);   Button with document.write() – removes all HTML and shows only output <button type=”button” onclick=”document.write(‘Pavan’)”>Click</button>   window.alert() – shows data in alert box window.alert(“Pavan”);   console.log() – used for debugging console.log(“Pavan”); Instructions: Programming means giving instructions to the machine. Instructions are written as statements. JavaScript executes statements from top to bottom. Statements may contain values, operators, expressions, comments, and keywords. Semicolon (;) ends a statement. Example var x = 10; var y = 20; var z = x + y; We can break a line after an operator: var total = x + y; Keywords: Some important JavaScript keywords:break, continue, debugger, do…while, for,function, if…else, return, switch, try…catch Syntax: var KeywordThe var keyword tells the browser to create a variable in JavaScript. ValuesThere are two types of values in JavaScript:1. Literals (Fixed Values)These are hardcoded or constant values.10“Pavan”true 2. Variables (Stored Values)These values are stored in variables.var name = “Pavan”; Case Sensitivity:JavaScript is case-sensitive, meaning variable names with different cases are treated as different variables. var lastname = “A”;var Lastname = “B”; // Both are different variables Variable Declarations:You can declare variables in different ways: var y; // Declared but undefinedvar f, g, h; // Multiple variable declaration String Concatenation ExampleUsing the + operator to combine strings:g = “P” + “a”; // Result: “Pa”f = g + “van”; // Result: “Pavan” Variables: Variables store data values. Variable names must be unique. Variables declared without var are global. Variable Rules: Can contain letters, digits, _, $Must start with a letterCase-sensitiveCannot use reserved keywordsvar x; // value is undefined Types of Variables: Types of Variables:1. Local Variable – accessible within a block function test() {var x = 10;} 2. Global Variable – accessible throughout the pagevar y = 20; Operators: = is the assignment operator and == is the equal operator  ++ increment  — decrement  null === undefined // false null == undefined //true  () operator invokes the function  Notes: myFunction; // returns function definitionmyFunction(); // returns function result Data Type: Primitive Data Type (normal data types which are without properties and methods):  String Number Bolean Undefined Null  Non-Primitive Data Types:  Object Array RegExp  typeof undefined // undefined typeof null // object  Function: for reusability of code  We invoke the function on  any event occurs (on click of user)  () from JavaScript code  Automatically (self-invoked)  Events: onChange  onClick  onMouseover  onMouseout  onKeydown  onLoad  Object: var training = {trainername: “Abel”,skill: “ServiceNow”,id: 111,trainerwithskill: function() {return this.trainername + ” ” + this.skill;}}; var t1 = training.trainerwithskill(); // function valuevar t2 = training.trainerwithskill; // function definitionvar t3 = training.skill;var t4 = training[“skill”]; JavaScript Looping examples: If-else:  if (a < 1) { skill = “Java”; } else if (a < 2) { skill = “PHP”; } else { skill = “Servicenow”; }  For loop:  Example 1  for (i = 1; i < 5; i++) { text += “Servicenow chapter ” + i + ” “; }  Example 2 j=1; for (; j < 5; j++) { text += “Servicenow chapter ” + i + ” “; }  Example 3  var trainer = {name:”Pavan”, skill:”Java”, age:28};  var text = “”; var x; for (x in trainer) { text += trainer[x]; }  Example 4 var txt = “”; var trainer = [{name:”Pavan”, skill:”Java”, age:28},{name:”Paavan”, skill:”Java”, age:28}];  var x; for (x in trainer) { txt += trainer[x][“name”]; }  document.getElementById(“demo”).innerHTML = txt;   Switch:  switch (new Date().getDay()) { case 0: day = “Today is Sunday”; break; case 1: day = “Today is Today is Monday”; break; case 2: day = “Today is Tuesday”; break; case 3: day = “Today is Wednesday”; break; case 4: day = “Today is Thursday”; break; case 5: day = “Today is Friday”; break; case 6: day = “Today is Saturday”; break; default: day = “No Default”; }  while loop:  while (i < 10) { text += “The number is ” + i; i++; }  do while loop:  do { text += “The number is ” + i; i++; } while (i < 10);  JavaScript Function: function is an Object in JavaScript  JavaScript function has properties as well as methods.  Normal Functionfunction myFunction(a, b) {return a * b;}var x = myFunction(4, 3); Anonymous Functionvar pp = function() {alert(“Hi this is anonymous function”);}; Constructor Functionfunction Member(a, b) {this.name = a;this.skill = b;}var t = new Member(“Pavan”, “ServiceNow”);var g = new Member(“Pankaj”, “Java”); Arrow Function// ES5var x = function(p, q) {return p * q;};// ES6const x = (p, q) => p * q; Callback FunctionA callback function is a function passed as an argument to another function. function p1(x) {return x;}function p2(b, callback) {callback(b);}p2(2, p1);p2(3, function() {alert(“Hi”);});

Service Portal

Service Portal Basic Widget in Service-now Service Portal is a powerful framework for building self-service websites and custom web app UIs. Using a hierarchy of table driven components, Service Portal simplifies the process and reduces the code required to build a web interface. With Service Portal, you can deliver your apps to employees through a modern, easy to use portal they can access from any device, any time. To create a service portal, navigate to Service Portal => portals => New button, the following form will be displayed, Enter Title , URL suffix (used to run the service portal in the browser) as shown in above form. To run this portal,write URL suffix at the end of the current instance URL as below, Page Pages control where and how you store portal content. To create page navigate to Service Portal => Pages and click on New Button to create a page. The following form will be displayed , Enter the title ,Id for the page and save the changes. After creating this page,At the bottom click on “Open in Designer” link, to create the content on the page,as below, The following “Page Designer” will be displayed on the browser , From the Widgets tab at the left , from layouts , First we need to add a container and then divide that container using a required grid to divide the space in the container. In the below snapshot we have added the container and  [6 6] grid and we have added widgets calculator and clock as a content , You can add this page to portal by following way, Open your service portal and select Homepage as the page name that we want to add. Now go to the portal by entering the URL suffix (snowtraining) at the end of the current instance URL in the browser,you will get the page that we have added as below, Menus To create Menu,navigate to Service Portal => Menus and click on New button to create the Menu as below, How this Menu should appear on the page we can select in widget, For example , below,Training Menu should appear as Header Menu on a page so select “Header Menu” as Widget as below, Save above Menu. Add Menu Item by clicking “New” button from “Menu Item” section at the bottom as below, Create Menu item as shown in below screenshot, As shown in above screenshot, Enter Type of Menu,Catalog item and Page for that menu Type : Catalog Item Page : this decides where to display catalog item, “sc_cat_item”  is used to display catalog item. You can add these above Menu to the service portal by selecting the Menu as below, Service Portal Configuration Branding Editor :  Used to customize the portal’s title,logo and theme colors. Navigate to Service Portal => Service Portal Configurator as below,  The following configuration page will be displayed in the browser, Click on Branding Editor,to customize portal’s title,logo and theme colors. The following page will be displayed, Simple List example : Create a page to display a list of incidents and problems using Simple List widget. ’  Click on Open in Designer to design a page,  Drag and drop 2 containers and divide them using grid as below, Drag and Drop a Simple List widget into Container 1 as follows, Click on pencil to edit the list,following window will be displayed, Configure 2nd simple list for Problem table as below, We can link this page to Menu. Create one menu and link the above page(tr_incident) to it as follows, Save the above Menu and go to the portal,you can see the Menu named as Ticket that we have  just created as follows, Click on that Ticket Menu,the list of incident and problem will be displayed as follows, If you click on any incident ,the following page will be displayed in which we can only write the issues.,because on the page we have set Link Type as Ticket., Click on any Problem, The form will be displayed as follows because on page we have set Link Type as Form. Add Search on Homepage : We can use existing instances on a page. For example , Use “Search” from the below Service Portal to our Service Portal , For that ,open Service Portal and check which instance is used for displaying “Search” on Homepage  in this service portal, Open a Record of Homepage to know the instance as follows, The following Page will be displayed and you can see the “Homepage Search” instance is used to display the Search on HomePage. Now,Open our homepage in design mode and add one container at the top and drag and drop “HomePage Search”in that container as below, Navigate to our portal by entering our developer instance URL with suffix snowtraining ,the “Search” will be displayed as follows, Design Page without Designer: You can design a page directly on the page without using Designer. For that ,open a page ,at the bottom there is a list of containers. Create a new container by clicking on New button, At the bottom, Click on Column 1 of newly created container as below, At the bottom click on New button to create the instance , Widget Data Table : Class – Instance with Table Here you can add widget,take data table as a widget as follows, When you use the Data table as a widget,you need to select a table. For that first Select “Instance with Table” as a Class, (if class field is not available on the form then display it from Form Layout =>Slush Bucket) Save it and then you will get some more fields on the form where you can select a table as below, Display Icon : To display icon,select “Icon Link” as a widget and Class “Instance with Link”, Save the above form. Now, After clicking on that icon,we need to select what should be displayed,as below, Navigate to Service Portal URL, you will see the Icon which we have created