Transform Script to update Location field in Transform Map

Saib1
Tera Guru

Hi ,

I need to update the Target field based on the input from Source in Transform Map . 

Below is the Source Fields and Traget field

Need to hard code through script for the following 

For Example : if (San Newyork) update in target as Newyork

 Please help on this writing transform script.

 

 

find_real_file.png

11 REPLIES 11

Hi Ankur,

The script which you have given is updating undefined

are you giving correct display value for the location?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur 

 

location is reference field. Not sure how to give the display value. Can you tell me ?

Hi,

then the location name you are returning is the exact name?

where are you writing this script? is this in field map or onBefore transform script?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Linda S
ServiceNow Employee
ServiceNow Employee

There are a few places you can do a script during a transform - I'm assuming you are using the script in the field mapping, if so then you want the following.  Note that for referenced value field name, since location is a reference field, I selected Name so the transform will attempt to match what the script returns to the name field and set the target if match is found....

 

find_real_file.png