Update target with a null value if the source is null from transform map

Community Alums
Not applicable

Update target with a null value if the source is null from transform map with out using 'Copy Empty Fields'

 

I have used below script but it is not working, could I get some help here please

answer = (function transformEntry(source,target) {

//var gdt = new GlideDateTime(source.u_last_day);
//return gdt.getValue();
//if (source.u_last_day == '') {
if (source.u_last_day.nil()){
target.u_last_day == '';
}

})(source);

22 REPLIES 22

Community Alums
Not applicable

@Mahesh Baraskar I tired below, it is still not copying blank values from source to target

 

 

answer = (function transformEntry(source,target) {

var gdt = new GlideDateTime(source.u_last_day);
return gdt.getValue();

if (source.u_last_day.nil()){

var null_date = new Date(0);

target.u_last_day = null_date;

//target.setValue('u_last_day', '');
}

else{

target.u_last_day = source.u_last_day;

}
})(source);

Kim75
Tera Contributor

Did you ever get this to work?  I'm have a similar situation that needs to be corrected.

@Kim75 ,

 

What is the issue you are facing?

Can you please add more details.

 

Thanks,