The CreatorCon Call for Content is officially open! Get started here.

getting a sysid and using it to lookup a name

drichter
Kilo Contributor

why won't this script use the sys_id returned by gs.getUserID()) to look up the name ?
it is displaying the message within the next loop, which tells me it found the sys_id, but the user name is blank.

var u=new GlideRecord('sys_user');
u.addQuery('sys_id',gs.getUserID());
u.query();
while (u.next() ) {
gs.log (" u.name:",u.last_name);
}

Thank you.

5 REPLIES 5

Thank you Mark. Thats an amazing site ! I posted a reply to one of your tips there about import and scripting, that is a re-phrase of my other question posted here, about schedule_data_import.