Ignore Import Set Row if Value is...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2020 01:09 PM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2020 01:16 PM
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