Pratiksha Kalam
Kilo Sage

Hi sarahyelton,

This below code will help you ,

(function executeRule(current, previous /*null when async*/) {
// gs.addInfoMessage(current.u_ritm);
var getReqby = new GlideRecord('sc_req_item');
getReqby.addQuery('sys_id', current.u_ritm);
getReqby.query();
if(getReqby.next()){
current.u_requested_by = getReqby.request.requested_for;
current.u_uses_netid_s =getReqby.variables.netid_passwords;

 

 

OR

 

var usr= new GlideRecord("sys_user");

usr.addQuery("sys_id",g_form.getValue("variable name goes here"));

usr.query(callBack);

function callBack(usr){

if(usr.next()){

g_form.setValue("variable name goes here",usr.employee_number);

}

}

 

If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons.

 

Regards,

Pratiksha