Reltio to Salesforce

You can use hooks such as tenantStreamingVerification, tenantRequestModification, sfdcDataModification, and so on while implementing business logic from Reltio to Salesforce direction.

  • tenantStreamingVerification Use this hook to define if the Reltio event needs to be processed.

    tenantStreamingVerification is called when the connector processes events generated by the Reltio platform. The events indicate whether a Reltio entity has been created, updated, deleted or merged. In default cases, with no hooks implemented, the connector will process the event by reading the entity and sending it to Salesforce.

    However, this default process can be customized by implementing the tenantStreamingVerification hook. It takes the Reltio entity (in JSON format) as a parameter. It returns a boolean true or false, indicating whether the connector proceeds to send the data or stops sending the record to Salesforce.

    Example:

    tenantStreamingVerification (/*Reltio Object JSON*/reltioObject) {
            this.logging(`Start process for ${reltioObject.uri}`);
            if (reltioObject.attributes.SFDCSync) {
                const vs = reltioObject.attributes.SFDCSync;
                if (Array.isArray(vs)) {
                    for (let i = 0; i < vs.length; i++) {
                        const v = vs[i];
                        if (v && v['ov'] === true && v['value'] === 'true') {
                            return true;
                        }
                    }
                }
            }
            return false;  
  • tenantRequestModification With this hook you can modify Reltio data before converting it in the mapper.

    Before the entity data is converted to a Salesforce object format based on the mapping, you can change values of the entity data through the tenantRequestModification hook. It also uses a Reltio entity as an input and output parameter.

    Example:

    tenantRequestModification (reltioObject) {
      this.logging(`Start process ${reltioObject.uri}`);
      if (reltioObject && reltioObject['attributes']) {
          const fnAttr = object['attributes']['FirstName'];
          if (fnAttr && fnAttr[0].value === 'DEFAULT') {
              fnAttr[0].value = 'NOT_SET';
          }
      }
      return reltioObject;
  • sfdcDataModification You can modify already converted Reltio data to send it to Salesforce.

    After the Reltio entity has been transformed to Salesforce object format through the mapping file, you can change the data using the sfdcDataModification before it is sent to Salesforce.

    The hook uses the following parameters:

    Table 1. 'relatedObjects' fields in 'to_salesforce' Fields and Applied Checks
    Parameter Description
    sfdcRequest sobject after entity conversion
    entity Reltio entity
    reltioAttribute Reltio attribute. Exists only after conversion reltio attribute mapped to custom sobject in relatedObjects mapping. Example: Reltio attribute Address mapped to sobject Address__c
    Example:
    sfdcDataModification (sfdcRequest, entity, reltioAttribute) {
      this.logging(`Start process ${sfdcRequest.Name}`);
      if (sfdcRequest.attributes.type === 'Account') {
    	if (sfdcRequest.Name && sfdcRequest.Name.startsWith('Test_')) {
    		sfdcRequest.OrganizationType__c = 'QA'
    	}
      }
      return sfdcRequest;
  • callbackModification Update the data before callback, to send it to Reltio.

    Callback is used when an update is sent from Reltio to Salesforce, and that update also needs to be part of the Salesforce crosswalk maintained for Reltio entity. You can use the callbackModification hook to change the data before it is updated in the crosswalk. It takes the entity callback data as the input and output parameter.

    callbackModification (/*Reltio request*/ callback) {
        this.logging(`Start process ${callback.uri}`);
        if (object.type === 'configuration/entityTypes/HCP') {
    		object.attributes['CallName'] = [{
    			"value": callback.attributes['FirstName'][0]["value"] + '_' + object.attributes['LastName'][0]["value"]
    		}];
    	}
    	return callback;
    }