- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 02:38 PM
I am trying to setup an import of a csv that contains additional employee information (birthday, hire date, etc - things that don't belong in user record). I am having trouble getting it to work. I am trying to coalesce on the user. The value in the User field is first name and last name - Daniel Shock, for example. This information is not in the CSV...so I am trying to query the matching employee ID that is in both the user table and the csv. and then update the other fields. So far this is not working. I see two warning in the import log that seem to indicate whats going on. 1 -something about the coalesce value not being present....which I'm sure it is...the field names are correct. and 2 - the target is not defined in line 6 of the script....
any help would be appreciated!! Thanks!
Solved! Go to Solution.
- Labels:
-
HR Service Delivery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 02:28 PM
Use this
answer = (function transformEntry(source) {
var empid = source.u_ï___empid_;
var userid = new GlideRecord('sys_user');
userid.addQuery('u_employee_id', empid);
userid.query();
if(userid.next()){
return userid.sys_id;
}
return "";
})(source);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 02:43 PM
That worked!!! Thank you!