First Names and Last Name auto populated in variables : catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 08:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 08:43 AM
Hi Allu,
Can I ask what the use case is for this since the name is available via the reference field?
You can use a default value for the variable like this:
javascript:gs.getUser().getFirstName();
javascript:gs.getUser().getLastName();
http://wiki.servicenow.com/index.php?title=Getting_a_User_Object#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 08:59 AM
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 09:46 AM
Hi Allu,
you can do this by writing a simple onLoad catalog client script :
function onLoad() {
g_form.setValue('fname',g_user.firstName);
g_form.setValue('lname',g_user.lastName);
}
Screen shots for your reference:
1. Write a Catalog client script like this.
2.
Thanks,
Shivam
PS: Mark Correct/Helpful /Like based on the effect of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 11:22 AM
Hi Allu,
Please mark the correct answer if we solved your problem, it will help others who will stuck in the same use case.
Thanks,
Shivam