Need a Bit of Understanding on Transform map with Data Source
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2024 02:25 PM
Hello Experts,
I am using Data Source to transform data from an SQL Database to CMDB. With the SQL query and transform map in the cmdb_ci_handheld_computing && SurfaceHub, along with the selection of the Coalesce field, I was expecting the transform map to work fine. However, I have seen that once the load all records are run, it just loaded double the records. I selected the Correlation ID & Name as Coalesce field however after the first run, just to be sure I ran the load again, it did not create any more duplicates.
My Question is ' Why did it create duplicate in the first run and in the consecutive run it is working as expected
The following
1. Onbefore transform Script is in place
2. CI Identifier rule is placed on the hardware table
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Call CMDB API to do Identification and Reconciliation of current row
var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.identifyAndReconcile(source, map, log);
ignore = false;
if (cmdbUtil.hasError()) {
var errorMessage = cmdbUtil.getError();
log.error(errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
}
})(source, map, log, target);