LogiUpSkill

Transform Map Scripts

Transform Map Scripts Go to Transform Map – Click on New.  We can write script in the transform map by checking the run Script checkbox.  And another way to write a script is in the Field Map to Check the Use Source Script  Or another way is Click on Transform Script- new  These are the Three ways in Transform mapping where we can write the Script  n Load Data Transfer seven types of scripting is present they are as follows: 1.onStart:- Executes at the beginning of the transformation process. Or It Runs only once, before any row is processed.  It is used for File validation, initialize variables, Stop entire transform Use Case: – Abort transform if the wrong source table is used.  2.onAfter:-Executes after each record is inserted or updated. or it runs for every row  After mappings are complete.  It is Used for Update target record, add work notes, Create related records.  Use case: – Add work note after incident creation.  3.onBefore:-Executes before each record is inserted or updated.  or it will run for every row and Before field mappings.  It is Used for Modify source data, set default values, Skip individual rows.  Use Case: – Set default priority if empty.  onChoiceCreate:-Executes when a choice value needs to be created during the transformation. or it runs When a new choice value is created during transform.  It is used for Modify choice labels, Control Dynamic Choice Creation.  Use Case: – Convert imported priority value into proper label.  onComplete:- Executes at the end of the transformation process. Or it runs Once and After all rows are processed.  It is used for Logging, Notifications, Cleanup.  Use Case: – Log transform completion.  onForeignInsert:- Executes when a related record is inserted. Or it runs when a new reference (foreign) record is created.  It is used for Modify referenced records, Set default values for reference tables.  Use Case: – Create new caller in sys_user during Incident import 7.onReject: – Executes when a record is rejected during the transformation.  or It runs When a record is rejected and ignore = true or transform error occurs  It is used for Error handling, Logging rejected records.  Use Case: – Log skipped records. 

Application Menu and Module in Service-now

Application Menu and Module in Service-now Tables in ServiceNow, Create Users : sys_user (Table ) Create Roles : sys_user_role (Table ) Assign a role to user : sys_user_has_role (Mapping Table (User – Role) ) Create Group : sys_user_group (Table ) Add user in a Group : sys_user_grmember ( Mapping Table) Assign a Role to Group : sys_group_has_role (Mapping Table) Add one Role into another Role : sys_user_role_contains (Mapping Table) In ServiceNow, Survey – User Groups User Administration – User Roles Table having mapping of user and role You can find Group Role by writing Group Role in Navigation Panel as below, Get a list of group members by writing sys_user_grmember.list in navigation panel as below, If you write sys_user.list in Navigation filter , and Enter, You will find a list of all users. List Of Users : We can find a table name by 2 ways Configure table 2. Table name can find in URL , What is context menu? Application Menu : To Create Application Menu , Go To Application Menu in Navigation panel as shown in the picture below. To Create new application, Click on New Button ,as shown in below picture      While creating an Application,if Role is not assigned it means everyone can access this application. (Refer above figure) Application can be said as a container of modules. Every application contains Modules. Module : Modules are used to access the functionality of ServiceNow,these functionalities are dependent on tables. To create Modules ,search Module in Navigation Panel. Click on New Button to create new Module, as shown in above picture Write Module Name and Application Name under which we want to add Module, as shown in below picture,. E.g Module Name as Contains Role Module,       Application Name : LTI Training Instead of writing Application Name directly,You can select it from the list by clicking on the search button in Application Menu option. Visibility Tab : Override application menu roles : Allows users to access this module even if they do not have permission to view the containing application menu. Users must still meet the role requirements for this module. Link Type : Link type field specifies what type of link the module opens. We can find a lot of link types,as shown in the picture below. Table : Number of table can be seen under Table, For now, Take table name as sys_user_role_contains  and click on Submit,as shown in the picture below. So now,if you search LTI Training in a navigator filter, you can see it with the module which we have added previously. (See Below Picture ) If you click on that module you will see all the contained role list. We can Edit Application by clicking on Pencil near Application name as shown in below picture. we can find related modules at the bottom of the form. (See the picture below) In above Picture, If you click on New Button near Modules,a new form will be generated for new module and Application Name will be automatically displayed. Write Module Name,Link Type and Table name and Click on Submit button,as shown in above picture. Link Type URL example : See below picture for URL link type example.(_blank is used to open that link in new window) Note : If you assign any role to user then that user need to logout and login again to get that access. You can give an order to a module ,Double click below Order for the required module.( as shown in above picture,) Link Types Explanation : Link type field on the Module form specifies what type of link the module opens. Assessment Links to the assessment-based survey you select in the Assessment reference field. Content Page Displays the content page you select in the Content page reference field. Documentation Link Links to a documentation page and opens in a new tab or window. This link type is used with embedded metadata in documentation topics. To open an internal document from a module, use the URL (from Arguments) module link type. Homepage Displays the homepage you select in the Homepage reference field. HTML (from Arguments) Places HTML in the application navigator. This link type is used for more complicated links, where a flat URL is not customizable enough. Note: The HTML (from Arguments) link type is supported in UI15 and UI11 only. In UI16, use the URL (from Arguments) link type instead. Enter a value for the Arguments field. List Filter Displays an unpopulated list view for the table you select in the Table field. Allows users to specify a filter without loading the list first. Use the Filter field to define the default filter for the list. Use the View name field to specify a  List of Records Displays the list view for the table you select in the Table field. Use the Filter field to define the default filter for the list. Use the View name field to specify a view. Map Page Displays the map page you select in the Map page reference field. New Record Displays a form for creating a record in the table you select in the Table field. Use the View name field to specify a view. Use the Arguments field to apply a template. Run a Report Runs the saved report you select in the Report field. Script (from Arguments) Runs a script, as defined in the Arguments field. Note: Enter a value for the Arguments field. Search Screen Link that displays a blank form for searching records in the table. Use the View name field to specify a view. Note: Use the parameter &sysparm_result_view=view_name to define the view the results are rendered in. Note: All searches use a [starts with] query to search for matching text. Other query types are not supported in search screens. Separator Creates a division between modules. Enter a name in the Title field to add a section name that users can collapse or expand. Single Record Displays a form for a single record on the table. Use the

Dictionary Entry in Service-now

Dictionary Entry in Service-now Dictionary Entry : Types Of Fields : String Reference Choice field (Dependent field)         True/false field List Journal     To find the table name of a field ,Right click on that field,Click on Configure Dictionary as shown in below picture,     Details of that field will be displayed as shown in below picture,     To add new column to a Table ,Right click on the required form, click on Configure -> Dictionary as below,     Click on New to create new field on the following form,   Clicking on New Button ,Following form will be displayed where we can create fields of different types.     e.g  create a State field of Type String as shown in below picture,   The new field can be seen in the table as below,       Choice Type Example : Lets convert the State field to Choice Type. Right click on that field, Click on Configure Dictionary, as below       State field in Dictionary Entry will be displayed. In below Section, Choice List Specification, Select Dropdown with None as a Choice ,as shown below,     Save the changes as below,     To add values in that dropdown , Click on Choices Tab in below Section, Click on New Button, as shown in below picture,     The following form will be displayed after clicking on New Button.   The List can be seen in the Dropdown as below,     Dependent Field : This field is dependent on another field in a table. e.g  City depends on State     In Dictionary Entry for City , assign Dependent field as below,     We need to set Dependent Value also, as shown below,       Now, If we select Maharashtra state, Cities from Maharashtra only displayed in City dropdown., as shown below   Similarly for other state,another cities are displayed.   You can use existing Choice table also to display the List.     Reference Field : Field refers to another field.     The Reference field User will be added to the form as below,     You can select any user from a list of users from sys_user table by clicking on magnifying glass next to User as below,     After selecting a record, Display Value of that table (Reference table) will be displayed as below,         Display Value : This Value is a representation of that record in a reference field that is for whole table.Therefore there will be only one Display Value for a table. If there are more than one display value for a table then the updated value will be set as Display value.       Clicking on Open Record button , the entire record can be seen as below,  

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.

GlideDate in Servicenow

GlideDate in Servicenow gs.print(new GlideDateTime(“2011-08-01 12:00:00”).getDate()); var tt=new GlideDateTime().getDate();gs.print(tt); var ss=new GlideDateTime(“2017-11-04 12:00:00”).getDate();gs.print(ss); gs.print(Date()); …………………………………………………………………………. var g = new GlideDate();g.setValue(‘2015-01-01’);gs.info(g); var gDT = new GlideDateTime(g);gs.info(gDT); ……………………………………………………………………………………………………………. var gdt1 = new GlideDateTime(“2016-05-15”);var gdt2 = new GlideDateTime(gs.now());var dur = new GlideDuration(); var dur = GlideDateTime.subtract(gdt1, gdt2); //the difference between gdt1 and gdt2var temp = dur.getDisplayValue()gs.print(temp); var r= parseInt(temp);if(r==30 || r==60 || r==90){gs.print(“trigger”);}else{gs.print(“no”);} ……………………………………………………………………………………………………………………………………..   var gr = new GlideRecord(‘incident’);gr.get(‘784b900d4f4533001a0f45dba310c713’);var open= gr.opened_at;var gdt = new GlideDateTime(open);gdt.addDays(14);var due_date = gdt; gs.print(“Due Date After 14 days”+due_date); gs.print(“Numaric value for Open date”+gr.opened_at.dateNumericValue());   gs.print(“Open Date”+gr.opened_at); var tempp=gr.opened_at.dateNumericValue()+ 60000; gs.print(“final numaric value”+tempp); gr.opened_at.setDateNumericValue(tempp); gs.print(“Addding 60000 to Open date”+gr.opened_at.getValue());   ……………………………………………………………………………………………………………… var gdt1 = new GlideDateTime(“2019-04-24”); gs.print(gdt1); var gtime1 = new GlideTime();gtime1.setValue(“00:00:20”);gdt1.add(gtime1); gs.print(gdt1);   ………………………………………………………………………………………………………………………….. Javascript will not able give you the result without using time function var a = new Date(‘2013-11-05’);var b = new Date(‘2013-11-05’); if(a == b) {console.info(“a equals b”);}else {console.log(“a NOT equals b”);} if(a.getTime() == b.getTime()) {console.info(“a equals b”);}else {console.log(“a NOT equals b”);}

Dictionary Override  

Dictionary Override Dictionary Override will come into a picture when we have a parent-child relationship between tables. By default, all fields and their attributes are inherited from parent table to child tables. Suppose you want to make a difference in one of the child tables for inherited fields then we will go for Dictionary override.   We can override following properties     Override Reference Qualifiers: A Reference Qualifier in Dictionary Override allows you to change or customize the filtering condition of a reference field only for a specific child table, without affecting the original parent table field.  Override Dependent:-Makes the field dependent on some other field, only in the child table.  Override Default Value: Changes the default value of the field for the child table.   Override Read Only: – Make the field read-only for this child table only.  Override Calculations: – Overrides the calculation formula used by calculated fields.  Override Mandatory: – Makes the field mandatory or not mandatory only for this child table.  Override Attributes: Allows you to override field attributes only for the child table.  Override Display Values: – Allows overriding how the field’s display value is shown for this table.  Making Dictionary Override  Search Tables in Navigation Bar to Make Tables & Click on New.  After Clicking New Page will appear in that Add Table Name à New Menu Name   for Making Child Table We Have Click on Extensible. à Controls à Extensible Click on Box & Submit it, Your Table will be made which is Parent Table.  Now go to table for Making Child Tables in that Add Table Name, In Extends Table Give Name of parent Table to Make this table a child table & submit it.  Search tables for Parent & Child Tables in Navigation Bar, Perform Dictionary Override.  Users must Make Field from Form Layout in Parent Table & That field will automatically Inherit to Child tables.  Child Table All Fields Inherit from Parent Table.  Now Add Records in Parent Tables  Note: If User adds Records to Parent Table, then that record will not be visible in Child Tables. But when we insert records in Child tables then child table records will visible Parent tables.  If we have to do Perform operation on Parent table field   Go to Parent table fields à Configure Dictionary à In Right side, their option for doing Read only, Mandatory, Display.  If we have to Perform operation on child table field   Go to child table fields à Configure Dictionary à Dictionary override-> New-> There will be all operations.  Base Table: – is the parent table  Table: – The table where we can change override property.  These are the above properties by using, we can perform dictionary override.  Ex: – If User wants to do Override the name field by Read-only then user can do with the below steps.  Go to child Table->Right click on Name->Configure Dictionary->  Click On Dictionary Override-> Click on New.  Click on -> Override Read Only-> Sumit the Record.   After submitting the record check in the child table. If filed get read-only or not.  And here the field is read only.  Note: When we Apply Override in Child table, it does not Apply to Parent table. Summary:   Dictionary Override in ServiceNow is used when you have a parent–child table relationship and want a child table to behave differently from the parent. Normally, all fields and their properties are inherited from the parent table, but with a dictionary override you can change things like default values, read‑only settings, mandatory status, reference qualifiers, calculations, attributes, and display values only for the child table. To use it, you first create a parent table (by making it extensible) and then create a child table that extends it. Any field added to the parent automatically appears in the child, but records added in the parent do not show in the child, while child records appear in the parent. To override a field, open the child table, right‑click the inherited field, go to Configure Dictionary, and create a new Dictionary Override where you select the property you want to change. The override affects only the child’s table and never the parent.