How to skip a row in transform map insertion if field is empty

Alon Grod
Tera Expert

Hi,
how can I skip a row insertion in transform map if field specific field is empty.

 

if (source.u_computer_name == '') {
     skip row
}
else {
       return source.u_computer_name;

}

6 REPLIES 6

Namrata Ghorpad
Mega Sage

Hi @Alon Grod ,

Update script like below.

 

if (source.u_computer_name == '') {
     ignore=true;
}
else {
       return source.u_computer_name;

}

 

If my answer resolves your issue then please mark it as correct and helpful.

Regards,

Namrata

Namrata Ghorpad
Mega Sage

Rahul Kumar Ko1
Tera Expert

Hi @Alon Grod ,

 

Please use the On-before transform script to avoid the insertion like below

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

    if(gs.nil(source.todo_url))
        ignore = true;

})(source, map, log, target);
 
Kindly mark this answer as helpful if this works for you
 
Thanks,
Rahul.

@Rahul Kumar Ko1 @Namrata Ghorpad Im using source script in order to populate specific field and during this process i want to check if its empty then script entire row. It should not be something with AbortAction?