Transform Map not working as expected

sankon
Kilo Expert

I am trying to update email, phone and location only if there is no existing value for the field. I see that existing value is being updated by new value. Please let me know if I am missing anything. 

I created a transform map as follow

find_real_file.png

I have the following in my onBefore transform scripts

find_real_file.png

find_real_file.png

 

1 ACCEPTED SOLUTION

Tudor
Tera Guru

Hi Sankon,

If you are using a script to populate the values you should be able to remove all the filed mappings expect the field on which you are coalescing.

Please give it a try and provide feedback.

Hope this helps!

 Tudor 

View solution in original post

7 REPLIES 7

Tudor
Tera Guru

Hi Sankon,

If you are using a script to populate the values you should be able to remove all the filed mappings expect the field on which you are coalescing.

Please give it a try and provide feedback.

Hope this helps!

 Tudor 

Sukraj Raikhraj
Kilo Sage

like Tudor mentioned, you have those fields and the coalesce in the field mapping , that means any fields in those mapping will be updated so remove the fields from the mapping and keep the scripts.

sankon
Kilo Expert

1. If I have two onBefore() methods for transform map, does it execute lower order number first and if both have same order number how does it pick which  onBefore() first. 

2. Is it ok to combine both into one onBefore()  enclosing contents of second onBefore method in else condition after  if (action  ='insert') .

3. what is the difference between putting snippet directly vs putting in method or runTransformScript(source, map, log, target /*undefined onStart*/ )

sankon
Kilo Expert

Hi @THosu and @Sukraj Raikhraj,

   Thanks for the input. I see that location field is showing as empty even if source has a location value, the target record is not getting updated. Does this need additional code as this a reference field?