Transform Map Script

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Transform map script

Presenting by : Rutuja Jagdale


Priynash Sahu
Komal Kand
Rohan Hirave
Namrata Shinde
Todays agenda…

 What is transform map ?


 Data source…
 Transform map script..
 Types of Transform Scripts
 Use case implementation of transform event script
 Transform event script
 Types of transformation events
 Field map script
 Field map variable
 Use case implementation of field map
Transform map….
 A Transform Map matches the columns from the staging table/intermediate
table to the columns in the target table. Every import operation requires at
least one transform.
Data source
 For transferring different files into
the target tables, you will have to
create a data source for transforming
a file into the target table.
 To create data source just navigate
to data source inside the system
import sets application.
Transform map script

Transform Map scripts allow you to customize import operations


using a robust programming interface to introduce advanced logic.

A transform map script executes as events occur while an import set


is being transformed onto a Service Now table. Transform Map
scripting is fully integrated into the Service Now scripting
environment.

Totransform the data we need 2 tables, i.e. source table and target
table. And for source table we will have to create one data source.
Types of transform script…

 Explicit Transform Map scripts : which


explicitly define mapping relationships

 Transformation Event scripts : which modify


the processing of events at different stages of a
transformation
Use case for explicit transform script…
 When the excel sheet data transformed into ServiceNow
instance then in the short description of loaded data more
information such as (Already available Incident Record with
same short description) will get appended.

 Will Import or load data through excel sheet in ServiceNow


Instance.

 Through Transform Map Script manipulate the excel sheet


data before get saved in ServiceNow Instance.
Transform Event Scripts
 Transformation events occur during the process of
transforming an import set table onto a table.
 Transformation Event Scripts modify the
transformation behavior at different points in the
transformation process.
 ServiceNow provides 7 Transformation Events 
1. onStart,
2. onComplete
3. onBefore
4. onAfter
5. onForeignInsert
6. onChoiceCreate
7. onReject
 onStart :
 The first Transformation Event to get triggered will be
the onStart event.
 This event occurs immediately prior to starting the loop
and reading the first import record. it will only be
triggered a single time for an import run

 onBefore:
 The onBefore Transformation Event occurs within the
import loop each time a new record is read for
processing.
 The onBefore event occurs after the record has been
read from the Source and the Target is identified, but
before the data is actually loaded into the Target table. 
 onAfter :
 The onAfter Transformation Event, like the onBefore event, occurs
within the import loop each time a record is processed.
 The onAfter event gets triggered after the data has been transformed
and loaded into the Target table and prior to the next record being
read.
 It will be triggered multiple times per import run depending on the
number of records being imported.

 onComplete :
 The onComplete event occurs after all records have been processed
and the import loop has completed. Because it occurs outside of the
loop, it gets triggered only one time per import run
 onForeignInsert: The onForeignInsert event script is processed at the start
of the creation of a related, referenced record, before the record is created.

 onChoiceCreate: The onChoiceCreate event script is processed at the start


of a choice value creation, before the new choice value is created.

 onReject: The onReject event script is processed during the occurrence of a


foreign record or choice creation, and the foreign record or choice is
rejected ,the entire transformation row is not saved.
Field Map Script
 Field maps establish a
relationship between a field in an
import set table and a field in the
target table. Backend table name :sys_transform_entry

 In Service Now, each of the field-


level mappings is called a Field
Map and
 It is stored as a record in
the Field Map
[sys_transform_entry] table. 
 Role required:
import_transformer,
import_admin, or admin
Field map script variables
 target: It is a type of Glide Record. The record from the
target table that is currently being processed.
 source: It is a type of Glide Record. The record from the
source table that is currently being processed.
 answer: It is a String type. The field value to set in the
target record. 
 map: It is a type of a GlideTransformMap. Read-only
information about the current transform map record.
 action: Contains either the value insert or update,
depending on whether the current target row will be created
or updated.
 The action variable is available only when the Coalesce field
is false.
Use case scenario for field map script

 In the field map script populate the target table


priority field based on the values of impact and
urgency.
Thank you…

You might also like