Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Ignore Import Set Row if Value is...

AndyB5000
Mega Guru

We have 5 divisions in our company and we have a vendor that sends over Asset information to an import set and then a transform map updates the records.   However we now have a requirement in which we want to ignore the import set row if the Division value is one of the 5 divisions.

I have created an OnBefore transform map script:

 

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

if(source.u_company == 'Division A');

ignore = true;

})(source, map, log, target);

 

But it worked to good as it ignored every record that was received instead of just ignoring those records with the specific division..

 

I am assuming the 'IF' statement is incorrect.  Should I use the sys_id of the division instead of the label or is there something else missing.

 

Thanks!!!

Andy

 

1 REPLY 1

Chander Bhusha1
Tera Guru

Hi ,

Seems that you have written semi colon in if statement.

Can you try remvoing that 

script:

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

if(source.u_company == 'Division A')
ignore = true;

})(source, map, log, target);

 

Mark helpful and correct if it helps.

 

Thanks,

CB