How to auto populate current login user name

klbhargav3
Tera Contributor

in catalog item there is a item deatils section in that there is a short description field i have you pass current login user name dynamically 

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @klbhargav3 

Where do you want to populate the current caller — in the native view or in a catalog variable?

 

https://www.servicenow.com/community/developer-forum/catalog-item-populate-user-id-user-name/m-p/156...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Nikhil Bajaj9
Tera Sage
Tera Sage

Hi @klbhargav3 ,

 

You can try- catalog client script and g_user class methods.

 

If my answer helepd you, please mark it- solution accepted. 

 

Regards,

Nikhil Bajaj

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

ServiceNow Rising Star-2025

Bhuvan
Giga Patron

@klbhargav3 

 

It is a simple task, refer below

 

https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-auto-populate-the-logged-in...

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

Rafael Batistot
Kilo Patron

hi @klbhargav3 

In the "Default Value" aba

RafaelBatistot_0-1756236874859.png

javascript: gs.getUserName() -> User Name

javascript: gs.getUserID() -> sys_id from User

javascript: gs.getUser().getEmail() -> Email associate of user


 

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.