Skip to main content

HelloID

Complex source mappings

HelloID supports JavaScript for complex mappings. Use them to transform or format mapped user attributes using custom JavaScript code. Complex mappings support the ECMAScript 5.1 standard.

Use the source object to access the key/value pairs in the person hash tables of your Persons import script. This object's properties correspond to the keys. For example, an employee's first name may be available at source.firstname. Do not attempt to initialize or overwrite these properties.

The following script is an example of a complex source mapping.

function getFamilyNamePartner() {
    if (source.Partner) {
        return source.Partner.LastName;
    } else {
        return null;
    }
}

getFamilyNamePartner();
Remove diacritical characters

HelloID provides a deleteDiacriticalMarks() JavaScript function. This function replaces non-ASCII diacritical characters within a string, with their ASCII equivalents.

function removeDiacrit(){
    // Replace diacritical characters
    var saniName = deleteDiacriticalMarks(source.FirstName);
    return saniName
}

removeDiacrit()

The following character replacements are supported: ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇĆçćÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠṠṢṤṦṨŞšṡṣṥṧṩşŸÿýŽž'