Help with Transform onBefore Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 11:42 AM
Hi
I have the following onBefore script active on a transform. This is to identify Apple devices only as there are different types of devices in the import set. When processing the transform, all 4000+ entries are ignored with comment 'Row transform ignored by onBefore script'
On the source table there is a field called u_operatingsystem and it does have iOS as the value but they are still being ignored
(function runTransformScript(source, map, log, target) {
// Only process Apple mobile devices
if (source.u_operatingsystem == "iOS") {
// Call CMDB API to do Identification and Reconciliation of current row
var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.identifyAndReconcile(source, map, log);
if (cmdbUtil.hasError()) {
var errorMessage = cmdbUtil.getError();
log.error(errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
}
}
ignore = true;
})(source, map, log, target);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 11:53 AM
@Adam Wood Your entries are ignored because on the second last line of your script you are setting the ignore variable to true.
ignore = true;
})(source, map, log, target);
This is causing all the entries to be ignored.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2023 12:13 PM
Hi
ignore = true, means that row is completely ignored and process moves to the next row, since it is onBefore script so, every record ignored by the script.
Remove the ignore statement and try it.