Transform map is not updating one specific field.

mnreddy
Mega Guru

Hello All,

We have SCCM 2016 integration/plug in in place. The requirement is to clear a value in the target table before one of the data sources and the transform map runs, so that transform map can populate that value as a new value every time. I created an "On Before" transform script (Since I need to delete the value before transformation, I am using on before)  and with that I am able to clear the value in the target table. However, transform map is able to update all other information on the target record except the one I am clearing via on before script. Any idea why transform map is not able to populate/update just that one field? Also is there any documentation available to understand the SCCM 2016 integration better?(Apart from ServiceNow docs). Thank you.

My on before transform script:

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

// Add your code here
var rId = source.u_id;
var bios = source.u_number;

var gr = new GlideRecord ('cmdb_ci_computer');
gr.addQuery('correlation_id',rId);
gr.query();
if (gr.next()){

if (bios == gr.number){//If this value matches with target record, do nothing.
return;
}else{
var gr1 = new GlideRecord('sys_object_source');
gr1.addQuery('id', gr.correlation_id);
gr1.query();
while(gr1.next()){
gr1.deleteRecord();//To delete records from the sys_obj_source.

}

gr.correlation_id = '';//To set the value on my target table as blank.
gr.update();
}
}
})(source, map, log, target);

 

Regards,

Mnreddy.

9 REPLIES 9

Hello Chaitanya,

I need to clear that value as part of the SCCM integration dependency. That filed is currently being used as an identifier and I need to clear this value so that system will treat that record as a new record and process it using a different identification method.

DrewW
Mega Sage
Mega Sage

If you do not check the "Copy empty fields" on the transform map it will not clear out fields that have values.

 

But the import set will always have the data in it and when the transform map happens that should be copied to the target field right?

what do you have in your transform map for the correlationid? in target table?

also, run business rules --- is it checked? if yes, what are those BR, are they impacting?

Yes but if the value is blank and the record that it found using the coalesce values has a value in the field it will not clear out the value in the record when it writes it to the DB.  And as nataliya_b mentioned if you are running BR's that could be setting a value in the field.