Import set - Unable to resolve target record, coalesce values not present

luigistracc
Tera Contributor

Hello there,

I need some help troubleshooting my data import.

The import set shows that the data is loaded correctly :
import set.png
import row.png

But when I run the transform map, all records are ignored and return the error “Unable to resolve target record, coalesce values not present: u_inventory_number.” and it runs endlessly if I do not cancel it manually. 
transform history.png

Here is the transform map and field map :
transform map.png
field map.png

I've seen on similar post that import_attribute_name needs to be different than Column name, is it still true ?
Here's the dictionary entry for u_inventory_number
dictionnary.png
Additionally, we have multiple similar Data Sources (for OS version, CIs, etc...) that work perfectly fine but every data source that deals with IPv4 does not work.

Do you have any idea what might be the issue?
Thanks a lot. Any help appreciated!

4 REPLIES 4

AnirudhKumar
Mega Sage

I see you are trying to do an manual import into the CMDB. In this scenario do not rely on Coalesce. The best practice is to make use the IRE during the import.

Refer to below documentation:

https://www.servicenow.com/docs/r/servicenow-platform/configuration-management-database-cmdb/identif...

 

Basically you will turn off coalesce on your field mappings and write an onBefore transform script containing the script in that documentation. Ensure you have Identification Rules and Entries in place for your CI class.

 

Also, on seeing your error now I think there are no values in your import set table for the field u_numero_dinventaire.
You have a coalesce on this field, and ServiceNow is trying to look for those values against u_inventory_number field in your IP Network table. If the value is empty, ServiceNow has nothing to compare against. 

 

Edit1: Added what additionally needs to be done in IRE

Edit2: Follow up question

Hi,

I've not been able to make it works with IRE.

Here are the Identification Rules and Entries in place for my CI class :
Identification rule.png
Is is correct ?

I also turned off coalesce on field mappings and added an onBefore transform script from documentation.

Now when I run the transform map, i'm getting "createOrUpdateCI failed." errors and by looking into the logs, I see that the payloads are empty :

identification_engine : logId:[22326029e9eb] Input = {"items":[{"className":"cmdb_ci_ip_network","values":{"subnet":"","comments":"","discovery_source":"external_cmdb","operational_status":"Production","name":"","u_inventory_number":""},"sys_object_source_info":{},"sys_ire_info":{}}]}


As I said in an other reply, the import set table (u_imp_reseau_ipv4) is empty, I think I have to fix the Data Source script in the first place.

Thanks a lot for your help.

Tanushree Maiti
Kilo Patron

Hi @luigistracc 

 

Please confirm  that your source data has no empty or null values in the u_inventory_number field, which is set as a coalesce field in the transform map.

The endless running could be the case that the system is repeatedly attempting to process the problematic record(s).

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Hi,

Every imported rows form import set has no empty or null values in the u_inventory_number field, but the import set table (u_imp_reseau_ipv4) is empty, it has no record at all.

I'm not sure to understand this, does it mean that data isn't inserted in the import set table ?

Here's a part of the data source script that is supposed to insert loaded data to import_set_table :

            var responseBodyObject = JSON.parse(responseBody);
            var dataList = responseBodyObject.datas;

            if (loopCount == 0) {
                var totalCountList = responseBodyObject.count; // get total number of CIs
                totalCountList = totalCountList / ciPerCall; //divide by the limit number
                var totalCountTruncArr = totalCountList.toString().split("."); //split result to retrieve whole part
                totalCountTruncInt = parseInt(totalCountTruncArr[0]); //retrieve whole part, this is the total number of calls we should make to retrieve all the CIs
            }
     

            for (var i in dataList) {
				
                var map = {};                
				map["u_numero_dinventaire"] = dataList[i].numero_dinventaire;
				map["u_reseau_ipv4"] = dataList[i].reseau_ipv4;
				map["u_etat"] = dataList[i].etat;
				map["u_domaine_dapplication"] = dataList[i].domaine_dapplication;
				map["u_commentaire"] = dataList[i].commentaire;
				import_set_table.insert(map);
				
            }
				
            }

As I said in my first post we have similar Data Sources that use script similar to this one and works, so i'm not sure that the script is faulty.

Thanks a lot for your help.