- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2020 09:31 PM
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()
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2020 09:58 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2020 10:09 PM
Ah right, haha... that's true haha. thanks for pointing out something so obvious haha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 12:27 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 12:36 AM
Can you post a separate question for this and tag me there so that I can help?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader