Aggregation value script
To make Merge suggestions and perform Automatic merges of persons, HelloID must match persons within and across source systems. This matching is based on each person's aggregation value.
An aggregation value is a string generated from selected personal attributes (e.g., initials, last name, date of birth) that uniquely identifies a person across systems. HelloID uses this value to determine which person records likely represent the same individual.
For each source system where automatic merging and/or merge suggestions are desired, you should Map an additional field to the Aggregation attribute on the Person tab of the source system.
Select Complex mapping and define the attribute using JavaScript. While the aggregation value could be a simple field — such as a person’s last name— a script is recommended to reduce mismatches and improve the accuracy of merge suggestions.
A default starter script is provided. You can customize it as needed:
function getAggregationValue() {
let value = ''
if (source.Initials) {
value = value.concat(source.Initials)
}
if (source.LastName) {
value = value.concat(source.LastName);
}
if (source.DateOfBirth) {
let d = new Date(source.DateOfBirth);
let birthDate = d.getFullYear() + '' + d.getMonth() + '' + d.getDate();
value = value.concat(birthDate);
}
if (source.PlaceOfBirth) {
value = value.concat(source.PlaceOfBirth);
}
if (source.Gender != null) {
value = value.concat(source.Gender === 0 ? "M" : "F");
}
return deleteDiacriticalMarks(value);
}
getAggregationValue();
For example, for John Smith, born in Amsterdam on January 1st, 1970, the script would output: JSmith197001AmsterdamM
.
Tips
The
source
object is filled with raw data from the source (after an import). Available fields depend on the source mapping.To inspect available fields, use
throw JSON.stringify(source)
.To avoid accidental matches, insert a numeric value, such as a date, zip code or house number, between alphabetical values. For example, names like "A.S. Mith" and "A. Smith" may result in a similar aggregation value if no separator is used.
When calculating the match score, HelloID gives slightly more weight to the middle of the aggregation value.
Special characters (except for single quotes:
'
) are ignored during comparison. This means that a character like Ä is not taken into account. Use thedeleteDiacriticalMarks
function to replace non-ASCII diacritical characters with their ASCII equivalents, e.g., replace Ä with A (see Remove diacritical characters).Use the Preview button to check if the resulting aggregation value is correct and unique.
Constraints
Aggregation value comparisons are not case-sensitive.
The Aggregation attribute is limited to 200 characters.
If the attribute is empty or null, the person will be excluded from automatic merging and merge suggestions.