Hull - Processor: Unified data via Priority rules
The code in index.js
can be copied directly into a (User) Processor in Hull and configured via variables to unify attributes based on various input attributes. The input attributes are considered in the order defined and the first matching input attribute will determine the value of the unified attribute. The code is also able to handle the unification of top-level attributes such as first_name
and last_name
to properly display that information in user profiles in Hull.
Example Scenarios
Unified last_name (top-level attribute)
Assuming you have various systems such as Salesforce and Hubspot connected to Hull, incoming data is stored as grouped attributes, so you most likely have the following attributes on a user profile:
salesforce_lead.last_name
salesforce_contact.last_name
hubspot.last_name
Now your team decides to pick up that the information and prioritize the data. You might end up defining that information about a customer which is represented as a Salesforce Contact has probably the most accurate data since it has been vetted, so salesforce_contact.last_name
takes top priority. If that data is not present, your team may decide that leads vetted by a sales person are still more accurate than marketing data from Hubspot, so you define that salesforce_lead.last_name
takes precedence over hubspot.last_name
.
Now all you have to do is to create a new variable in the Settings tab of the Processor under Custom Variables
to indicate that you want to apply a fallback strategy for the top-level attribute last_name
. So you enter the key fallbacks__last_name
and a value of salesforce_contact.last_name;salesforce_lead.last_name;hubspot.last_name;
. That's it, now the Processor will execute the logic to unify the top-level attribute last_name
for you.
Unified job_title
Assuming you have various systems such as Salesforce and Hubspot connected to Hull, incoming data is stored as grouped attributes, so you most likely have attributes similar to the following on a user profile:
salesforce_lead.title
salesforce_contact.title
hubspot.job_title
Now your team decides to pick up that the information and prioritize the data. You might end up defining that information about a customer which is represented as a Salesforce Contact has probably the most accurate data since it has been vetted, so salesforce_contact.title
takes top priority. If that data is not present, your team may decide that enriched marketing data in Hubspot is still more accurate than Sales data from leads, so you define that hubspot.job_title
takes precedence over salesforce_lead.title
.
Now all you have to do is to create a new variable in the Settings tab of the Processor under Custom Variables
to indicate that you want to apply a fallback strategy for the unified attribute job_title
. So you enter the key unified__job_title
and a value of salesforce_contact.title;hubspot.job_title;salesforce_lead.title
. That's it, now the Processor will execute the logic to unify the attribute job_title
and store the output in a group called unified
. To consolidate your systems, you should use in the outgoing data section of all connectors the attribute unified/job_title
instead of a cross-reference mapping from a particular other source.
Configuration
Configuration is entirely done via variables in the Settings of the Processor. The keys of the variables define the type of unification:
- keys following the convention
fallbacks__<ATTRIBUTE_NAME>
define top-level attribute unification; naturally there are only two values allowed for<ATTRIBUTE_NAME>
which arefirst_name
andlast_name
. It is not recommended to unify theemail
with that code even you can do it. - keys following the convention
unified__<ATTRIBUTE_NAME>
define grouped attribute unification; you can define any name that makes, but it is recommended to use asnake_cased
attribute name.
The value for each variable takes an ordered list devided by semicolons. The code will parse that list and apply the first matching attribute value as the value for the unified attribute