- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 07:57 PM
Hi all,
I need to autopopulate the mobile number field from the sys_user table on the catalog item:
I am using javascript:gs.getUser().getRecord().getDisplayValue("mobile_phone"); in the default value tab of the variable "Contact Number" to get this autopopulated, but it does not, any suggestions?
I do not need change this field through onChange or any Catalog client scripts as I am leaving this field open anyway for them to change the contact number if they want to (because for example: changed phone number but not updated on sys_user record).
Thanks.
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 09:05 PM
there's a gs.getUser() method for it, so you could use the following directly in the default value of the field or variable:
javascript: var userPhone; var user = new GlideRecord('sys_user'); if (user.get(gs.getUserID())) {userPhone = user.phone}; userPhone;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 09:01 PM
Try to default value code:
javascript:gs.getUser().getRecord().getDisplayValue("phone");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 09:05 PM
there's a gs.getUser() method for it, so you could use the following directly in the default value of the field or variable:
javascript: var userPhone; var user = new GlideRecord('sys_user'); if (user.get(gs.getUserID())) {userPhone = user.phone}; userPhone;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2019 04:09 AM
Hi RamS,
javascript: var userPhone; var user = new GlideRecord('sys_user'); if (user.get(gs.getUserID())) {userPhone = user.phone}; userPhone;
above script works perfectly as per my requirement in the default value, just needed to change "user.phone" to my name "user.mobile_phone".
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2025 09:40 AM
nice Mr.Ram !
fyi,given you a helpful !!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 09:02 PM
hi
U can use getReference();
Thanks,
Rahul Kumar