How to return user ID(on Record Producer)

Mi4
Tera Expert

Hi,

I want to return the User ID (user_name) of the current user information on Record Producer.
However, the name is returned.(Default Value)

javascript: var user = new GlideRecord('sys_user'); user.get(gs.getUserID()); user.user_name;

So here is my requirement to return "admin".

What should I do?

 

Thanks in advance,

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

ootb display value gives user full name on reference variable. 

you can create one custom variable (single line text type ) as user ID and there in default value pass 

javascript: gs.getUserName()

View solution in original post

2 REPLIES 2

Harsh Vardhan
Giga Patron

ootb display value gives user full name on reference variable. 

you can create one custom variable (single line text type ) as user ID and there in default value pass 

javascript: gs.getUserName()

Hi,

oh,I can't get it with the reference type.
understood.
Thank you ,Harshvardhan.

 

Regards,