Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 07:16 AM
Please adjust the function. comments inline.
function getUserId(email) {
var user_sys_id = "-1"; //No user found
var getSysId = new GlideRecord('sys_user');
getSysId.addQuery('user_name',email); //check if you are looking up in the correct field with email.
getSysId.setLimit(1);
getSysId.query();
if(getSysId.next()){
user_sys_id = getSysId.sys_id.toString();
}
return user_sys_id;
}
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022
Vinod Kumar Kachineni
Community Rising Star 2022