- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:24 AM
Hello,
I want to populate username (fullname) not user id in opened by family.Can anyone help?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:36 AM
Hi,
You can do this using the default value.
write below code:
javascript:gs.getUserDisplayName()
Please mark Helpful and Correct based on Impact.
Regards
Nikhil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:28 AM
Hi there,
How are you populating that user id now? For example default value gs.getUserID()?
Have you tried gs.getUserDisplayName()?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:34 AM
Hi,
You should use that:
//On change script on Requested for Field
var caller = g_form.getReference('requested_for',doAlert);
function doAlert(caller){
g_form.setValue('opened_by',caller.name); //opened by is variable name you can replace with you variabel name
}
This is if you want to add name of requsted for.
If you want to add name of loged in user
var name = g_user.firstName +' '+g_user.lastName
g_form.setValue('opened_by',name);
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:36 AM
Hi,
You can do this using the default value.
write below code:
javascript:gs.getUserDisplayName()
Please mark Helpful and Correct based on Impact.
Regards
Nikhil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:37 AM
Tnx for repeating exactly what I already mentioned.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field