How to identify the coalesce fields updating it via transform map?

Roxana4
Tera Contributor

I have a data source and transform map to update records in cmdb_ci_appl table. I need to update primary and secondary sites of some applicationn, We have coalesce on "name" and "application_id" fields to identify the records in target table. However, we have more than 1 record with same name and application_id in target table. So transform map is updating the first identified record. We need to put a validation in place so that correct record will be identified and updated by the transform map. The validation is like, if the sys_class_name ==  cmdb_ci_appl (this field is not in the map) then only update. Please note that our data source has only 4 fields in it, application_id name, primary site and secondary site, Any ideas on how this can be achieved? Thank you. 

10 REPLIES 10

Saurav11
Kilo Patron
Kilo Patron

Hello

Can you explain again if there are two records where name and application id matches hwhich record to update

Like what should tge system consider to identify tge record to update?

Thanks

Roxana4
Tera Contributor

Hi

it is correct I have 2 records where the name and the application id are repeated, the only one that must be updated is the record that meets this condition sys_class_name == cmdb_ci_appl

Wirte a onbefore transform script

If (target.sys_class_name !=cmdb_ci_appl)

{

ignore true;

}

Please mark answer correct/helpful based on impact

Roxana4
Tera Contributor

Hi Saurav! I just tried the onbefore transform script and it updated the record that has  sys_class_name different to cmdb_ci_appl, looks like is not working properly, attached screens of my transform map