- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 10:37 AM
I want to set current user (logged in) into String field and as well as in another field want to store time as per their time zone in service catalog. How should i do this?
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 10:40 AM
Hi there,
You could use a default value in the Single Line Text variable, with javascript:gs.getUserDisplayName(); and javascript:gs.getUser().getTZ();
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 11:15 AM
Just write an on load client script,
function onLoad() {
//Type appropriate comment here, and begin script below
var user = g_user.getFullName();
var date1 = new Date();
g_form.setValue("current_user",user);
g_form.setValue("time",date1);
}
OutPut will be
Kindly mark it correct and helpful if it solves your issue.
Thanks and Regards,
Anish Kumar