i have to map the nominated person in excel with subject person in hr case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 05:41 AM
I have to map the nominated person in excel with subject person(sn_hr_core_case_benefits)table in hr case.I need to get the user id(email-id) of the subject person from the back end table i.e.,(sys_user.do) table.For that i need to write source script in Field map.How can i write that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 05:51 AM
Hello @Burra Mounika
Greetings!
try below script
var userRecord = new GlideRecord('sys_user');
userRecord.addQuery('email', source.email_id); //add source email here
userRecord.query();
if(userRecord.next()){
var userID= userRecord.getUserID();
}
Please hit the thumb and Mark as correct if it helped!
Kind Regards,
Ravi Chandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 05:56 AM
Hi Ravi Chandra,
this is the page where i need to write source script in filed map form,there it mentioned as return" ";//return the value to be put in to the target field.as you can see attached image.what i need to return there??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 06:03 AM
what is the source field value for email.
var userRecord = new GlideRecord('sys_user');
userRecord.addQuery('email', source.email_id); //what is the source field value for email. I gave email_id
userRecord.query();
if(userRecord.next()){
var userID= userRecord.getUserID();
}
retun userID
Please hit the thumb and Mark as correct if it helped!
Kind Regards,
Ravi Chandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 06:10 AM
we are gliding sys_user table ryt?in sys_user table User id backend name is user_name.do i need to mention that in this line??userRecord.addQuery('email', source.email_id)--
in the place of email_id?