Mapping Additional D&B Data Fields

Review the CMPELF data model and identify any gaps with attributes and data containers for D&B data that you would like returned for your customer data. Once the gaps have been identified, manually create any required new attributes and data containers to store the incoming data.

To parse the data blocks' JSON response, the built-in default data mappings can be used to handle any data within the standard CMPELF product. However, JavaScript must be used for any data that was created as part of the gap analysis.

For more information about data blocks, refer to the topic Data Blocks in the Data Integration documentation

The JavaScript below shows how to parse and store D&B data to STEP.

Copy
dnbIntegrationContext.performDefaultEnrichingValidation(currentObject);
 if (dnbIntegrationContext.getIntegrationResult().getIntegrationException()) {
       return;
 }

 queryParams = new java.util.HashMap();
 //queryParams.put("blockIDs", "diversityinsight_L1_v1,paymentinsight_L3_v1");
 queryParams.put("blockIDs", "companyinfo_L3_v1,principalscontacts_L3_v2");
  queryParams.put("tradeUp", "hq");
  var dnbOrg = currentObject.getDnbOrganization();

 const dunsNumberSingleValue = dnbOrg.getValue("DnBDUNSNumber");
 var dunsNumber = dunsNumberSingleValue.getValue();
 for(i=dunsNumber.length(); i<9; i++) {
       dunsNumber = "0" + dunsNumber;
 }

 //Using this D&BEnrichConfigDataBlocks config to set integration status attributes, even though 'D&B Product' is set to 'Analytics Assessment Material Change (aasmcu)' The 'D&B Product' setting is not used.
 var operationConfiguration = currentObject.getManager().getHome(com.stibo.core.domain.setupentity.SetupEntityHome).getSetupEntityByID('D&BEnrichConfigDataBlocks'); //enrichOperationConfigurationID);
 var get = dnbGateway.rest().get();
 get.path("/v1/data/duns/" + dunsNumber);
 get.pathQuery(queryParams);
 get.header("Content-Type", "application/json");

 dnbIntegrationContext.setOperationConfiguration(operationConfiguration);
 jsonResult = get.invoke();

 //Save the JSON
 dnbOrg.setSimpleValue(DnBJSONDataBlocks, jsonResult);
 
 //Default built-in enrichment data mapping
 dnbIntegrationContext.performDefaultEnrichingDataMapping(currentObject, jsonResult);

 var responseObject = JSON.parse(jsonResult); 
 
 //Save data in Step
dnbOrg.setSimpleValue(nameManual, responseObject.organization.primaryName);