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

Auto populate depertment field

asd22
Tera Contributor

Hello. 

 

I have a script that works fine with auto populating fields when a user is selected:

asd22_0-1705490057375.png


My issue is it gets ID and status fine and displays it, but when i tried with setvalue on Department it only showed the sysID. I tried with getdisplayvalue, but now it does not display anything.

1 ACCEPTED SOLUTION

@asd22 

 

dot walk shoudl be sys_user.departmnet

May i know what is reason of u_department

*************************************************************************************************************
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]

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

View solution in original post

14 REPLIES 14

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @asd22 

 

Where are you trying to auto populate? Are you trying on catalog , if yes then you can use the Auto populate feature on variable. 

*************************************************************************************************************
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]

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

its a catalog item. I get the info from ID and STATUS when i select a user fine. But not wich unit / department the user is in.

Hi @asd22 

 

Try to give a thought about 

LearnNGrowAtul_0-1705491350256.png

 

https://www.servicenow.com/community/itsm-articles/using-the-variable-auto-populate-feature-with-var...

*************************************************************************************************************
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]

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

I would much rather have it in my script than use it