Using the Coalesce Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2012 09:19 AM
I am working on LDAP and trying to get the proper fields from my Active Directory field to come into the user records within service-now and I have since went back and added the field of employeeid to match within a field called employee number in the user record. The field map that I am coalescing on now is the samaccountname to user_name.
My question is that when I set the system to coalesce also on the employeeid as well as the samaccountname and then I run the scheduled load it will create all new record and import the user employeeid as designed, what I really want the system to do is if the samaccountname is found to coalesce as designed and not create a new record. I found this on the Wiki:
To only update records where a match is found, and skip records where a match is not found, specify a coalesce field and add the following script to the transform map.
if (action == 'insert')
ignore = true;
but not really sure where I should add it within the transform map. Here is the current script that I have within the transform map:
//
//the manager coming in from LDAP is the DN value for the manager.
// The line of code below will locate the manager that matches the
// DN value and set it into the target record. If you are not
// interested in getting the manager from LDAP then remove or
// comment out the line below
ldapUtils.setManager(source, target);
//
// Set the source LDAP server into the record
target.ldap_server = source.sys_import_set.data_source.ldap_target.server;
// Sets the Domain Field based on Source
if (source.u_source.indexOf("DC=AP") >= 0){
target.u_active_directory_domain = 'AP';
}
if (source.u_source.indexOf("DC=EU") >= 0){
target.u_active_directory_domain = 'EU';
}
Based off the recommendation on the Wiki, I should add this to that script?
if (action == 'insert')
ignore = true;
Where would I add this and is there any more syntax that I should include?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2012 04:58 AM
You're right since you have coalesce set to true it will look for a match using both fields. If one does not exist, and your script is in place, the user will not be imported.