How to clear the existing field values before the transform map update the values

Aditya Banka2
Tera Guru

Hello Geeks,

Using a transform map, I need to update a list field with multiple values and with the help of below source field transform script, I am able to append the values as shown in below screenshot.

Field map script : answer = target.u_backup_type+','+source.u_backup_type;

Issue : For next day's run it again appends the same values. So, I need to wipe out the existing values first and then run the transform map.

Please let me know how to remove the existing field values before the transformation runs in.

 

find_real_file.png

 

find_real_file.png

 

find_real_file.png

 

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Update your script to

if (target.u_backup_type)

{

if (target.u_backup_type.indexOf(source.u_backup_type)==-1)

answer = target.u_backup_type+','+source.u_backup_type;

else

answer = target.u_backup_type;

}

else

answer = source.u_backup_type;

 


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

3 REPLIES 3

Ahmed Drar
Tera Guru
Tera Guru

Hi Aditya, try to remove target.u_backup_type from your script 

answer = source.u_backup_type;

 

Please mark my answer as Correct / Helpful based on the Impact.

SanjivMeher
Kilo Patron
Kilo Patron

Update your script to

if (target.u_backup_type)

{

if (target.u_backup_type.indexOf(source.u_backup_type)==-1)

answer = target.u_backup_type+','+source.u_backup_type;

else

answer = target.u_backup_type;

}

else

answer = source.u_backup_type;

 


Please mark this response as correct or helpful if it assisted you with your question.

Thank You Sanjiv. It worked