I am trying to setup an import into HR Profiles from CSV report. Need help with transform map script

Daniel Shock
Kilo Sage

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!find_real_file.png

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

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);

View solution in original post

5 REPLIES 5

That worked!!! Thank you!