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

How to set default value of user manager

Kifrez
Kilo Guru

Hi everyone,

Could you please assist me how to set default value of a variable?
I need user 2's manager to be the default value (Screenshot below)
This script is only get user who is opening the form.
Thanks in advanced for your assistance.

javascript:gs.getUser().getManagerID()

find_real_file.png

1 ACCEPTED SOLUTION

Hi,

If you want to set default value then set for both the variables

If on_behalf_of is auto-populated with logged in user then

This should work for the manager variable

Is that not working as expected? Did you check logged in user has Manager or not

javascript:gs.getUser().getManagerID()

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ah right, haha... that's true haha. thanks for pointing out something so obvious haha

HI,

javascript:gs.getUser().getManagerID() returns "undefined" (even if the currently logged in user has Manager).

Is there any other way how to get Manager of currently logged in user as a default value?

 

Thank you.

@Ivana Jedinecna 

Can you post a separate question for this and tag me there so that I can help?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader