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 Linda ,

If i want to give the else if how to apply here 

if (source.u_source_data_center.indexOf("San Newyork") > -1) {
return "Newyork";
}

else if (source.u_source_data_center.indexOf("Oracle Melbourne") > -1)

{
return "Melbourne";

}

 

But this else if condition not working . if part is working , second else if is not working.

Linda S
ServiceNow Employee
ServiceNow Employee

How many different 'if's' do you have?  I may suggest to opt into a lookup table but if there is only a couple then you can do another if instead of else if....