Using Email as to identify user's CIs instead of their full name

Brevin Fong
Tera Contributor

Hi,

 

Is it possible to use email address as "main identifier" for the CI that the user possesses?

 

For example, when importing data, it is possible to have 2 users with the same full names, but their email will always be unique. 

 

John Doe (john.doe@company.com) has 1 Dell Laptop

John Doe (john.doe2@company.com) has 1 Samsung Cellphone

 

When uploading the data and going through a transform map to put the data onto the target table, how will I make sure that the user's CI doesn't get mixed up with another user if they have the same full name? I need john.doe@company.com to have 1 dell laptop correctly assigned to under him and john.doe2@company.com to have 1 samsung cellphone correctly assigned to under him as well. As of now, when I upload an excel sheet filled with items that belongs to users, I use the mapping assist function to User's full name -> Assigned to. And this method only allows me to use the Users Full name as the key identifier. Is there a better method of doing this, or what am I missing? 

 

Not sure if this is the correct place to ask neither am I that good at explaining the issue, so let me know if there's more details I need to provide. Any input or recommendations will be appreciated, Thanks.

 

 

1 ACCEPTED SOLUTION

So if your actual issue here is how to correctly assign the users to the devices, here is what you will need to know:

 

1) Import your users from trusted data sources like LDAP and/or use an HRIS integration (e.g. Oracle, Workday, Sailpoint, etc.)

 

2) What is the most unique source data you can obtain about the assignment of your assets/CIs?  Ideally something like a network login or employee ID is going to be easier than a full name.

 

3) If it is truly only the Full Name of the user that you have in the source data, this may be OK, but you may need to first do some data scrubbing to make sure that everything is ready to coalesce.  There may be name changes, difference in spelling or formatting, etc.  Make sure you can do a lookup of the user.

 

4) When setting the Assigned to field (or any other reference field! see point #5) you will need to set it to the sys_id value of the User record that you look up.  You can script this or you may be able to just create a Field Mapping and specify thename field as the field to map the record to.  That should automatically put the correct User reference into the Assigned to field:

CMDBWhisperer_0-1670532988438.png

 

5. Notice that the above is a screen shot from a transform that is pointing to the Asset table.  This applies equally to Assets or CIs.  If you transform your source to Assets and you provide an appropriate Model and Model Category, and you coalesce on the Serial Number, then you will get an appropriate CI, and you won't use IntegrationHub-ETL or IRE (these are for CMDB only).  But in either case, remember that if the field you are mapping to, whether Assigned to, or Model, is a Reference field, you MUST either transform this data to a sys_id before setting it or specify the referenced value field name so that it will provide a valid reference.

 

If this is just a one-off import, and you don't have a lot of existing data, then you may be able to just do a direct import from Excel, as long as you verify first that you aren't going to create any duplicates.  IT's a simpler approach but I would definitely not recommend this as a standard repeatable process.  However, if you are looking to establish a repeatable process for importing devices, I would definitely recommend using a traditional Transform Map for Assets, or using IntegrationHub-ETL for CIs.  There is a bit of a learning curve for IntegrationHub-ETL, but once you get it, it will serve 95% of your data source integration needs for CMDB.  The key is to make sure you have reliable data that matches the identifier entries for the CI classes you want to import, e.g. Serial Number or Name for Hardware CIs.

 

Hope this helps!  Please mark this response as the correct answer and/or helpful, as applicable.

 


The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.

View solution in original post

7 REPLIES 7

Mohit_Gupta
Tera Guru
Tera Guru

Hi @Brevin Fong ,

 

I would suggest by using onbefore email script please fetch full name by using email and then map into the field below is the example

var ref = new GlideRecord("sys_user"); 
ref.addQuery("email", source.email); 
ref.query();
if(ref.next()){   target.field_name = ref.name; 
}

 

I hope this helps 

Please mark my answer correct if this helps you 

Thanks

Mohit

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Brevin Fong 

 

Yes you can make Email ID unique by making Field Mapping of Email ID as 'Coalesce' checked/true. This will check for the unique value of Email ID and will mape different CIs in your scenario.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

this only works assuming each user has one item correct? for example in a Cellphone class, if one user is assigned 2 cellphones, doesn't that make an error since only 1 unique email can be used for 1 item?

Hi @Brevin Fong 

 

Then you can make both Email ID and Item as Coalesce to make it combination of those 2 fields as unique.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023