Hitoshi Ozawa
Giga Sage

Hi Jeni,

If field "u_apprentice_eid" is a reference to the user table, then below script will set sys_id of a user to field u_user.

var gr = new GlideRecord('custom table 1');
gr.addEncodedQuery('nameSTARTSWITHJ');
gr.query();
if(gr.next()){
	var upd = gr.u_apprentice_eid.sys_id.toString(); // in this line I tried to get the sys_id of the user
	var notifs = new GlideRecord('custom table 2');
	notifs.initialize();
	notifs.u_send_date = '2022-08-26';
	notifs.u_user = upd;  
	notifs.insert();
}