The CreatorCon Call for Content is officially open! Get started here.

Source Field Map Scripts

Khozema Attar1
Tera Guru

Hello Experts,

I am using a Field map Source Script, the requirement is to set the impact field on incident table on the basis of incoming priority from the source table.

Ex. if the priority from the source table is 1 then the impact on target incident table should be set to 3-Low( value for this choice is 3).

Written the following but it isn't working.

Can anyone help on this?

find_real_file.png

find_real_file.png

Thanks

Khozema

1 ACCEPTED SOLUTION

Yes, you have to select the target field and target table in transform map



find_real_file.png


find_real_file.png


View solution in original post

9 REPLIES 9

madanm7786
Mega Guru

Hi Attar,



Can you please try,


if(source.u_priority == 1)


answer=3;




Thanks,


Maddy


it doesn't Work!


balaji_charapal
Kilo Guru

You have to write script some thing like below


if(source.u_priority == 1){


        return 3; //value of priority in servicnow table


}


else if (source.u_priority == 2){


        return 2; //value of priority in servicnow table


}


else


return 3;


answer = (function transformEntry(source) {


if(source.u_priority == 1){


        return 3; //value of priority in servicnow table


}


else if (source.u_priority == 2){


        return 2; //value of priority in servicnow table


}


else


return 3;


})(source);