Field mapping in Transform map

manju12
Tera Expert

Hi Team,

 

How to map the fields for dot walking fields in Transform map. Please let me know.

 

Thanks,

Manju

6 REPLIES 6

svirkar420
Tera Guru

Hi @manju12 , To fulfil your requirement you will have to use the transform map script. 

Script - 

var gr = new glideRecord('table_name);

gr.addQuery('target_fieldName',  source_field); //add the table name as target table and source table respectively

if(gr.next()){ 

gr.field = source_fields;

gr.update()

}

 

Hope this script fulfil your requirement if yes then mark it as helpful and accept this as a solution if your questions is answered. 

Tanushree Maiti
Mega Sage

There are several script places available  under transform map where you can do dot walking. 

So just check what script you are using and where the dot requirement is required.

 

1.  in the new map entry (sys_transform_entry) , there is a checkbox 'use source script' . If you check , you will get script place where you can do dot walking.

  

TanushreeMaiti_0-1771323590999.png

2. In your Table transform map, you have 'run script' option

TanushreeMaiti_1-1771323774175.png

 

3. Apart from that following type of transform script is available -

Types of Transform Map Scripts:
onStart: Runs once before any data rows are processed. Ideal for initializing variables, logging, or gathering pre-import data.
onBefore: Runs for every row before the data is mapped and saved to the target table. Used to manipulate data in the source table, perform complex validation, or set ignore = true to prevent a record from importing.
onAfter: Runs for every row after it has been transformed, inserted, or updated in the target table (target record is available). Ideal for updating related records, triggering notifications, or complex validation.
onComplete: Runs once after all rows have been imported. Used for post-import tasks like sending a summary email or cleaning up temporary data.
onChoiceCreate: Executes before a new choice value is created in a choice field.
onForeignInsert: Executes before a related reference record is created.
onReject: Executes if a row is rejected, specifically when choice action is set to 'reject'.
 
 
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: