- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2018 11:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 12:20 AM
Hi Ashutosh,
i requested currently logged in user Department only
now i got the result : javascript: gs.getUser().getDepartmentID();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2018 11:51 PM
Hi Karthikeya,
You can try to use "g_form" API to fetch values of currently logged in user to update the department field with,
https://www.servicenowguru.com/scripting/user-object-cheat-sheet/
https://www.servicenowguru.com/scripting/user-object-cheat-sheet/
If it should be dependent on a caller field then use Script Include to populate fields from the User table. Please check out this link,
Re: Auto populate user information on Load

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2018 11:52 PM
Hi
For the logged on user you can set the default value to either:
javascript:gs.getUser().getRecord().getValue('department');
if it is a string value
or
javascript:gs.getUser().getRecord().getDisplayValue('location');
if it is a value from a reference field.
Best regards
Per
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 12:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2018 11:56 PM
Hi,
Which users department you want logged in user or Requested for user.
Thanks,