- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 08:05 AM
Hi. I have a variable set for a variable type single text even if i put in a test text or number in the default value it does not show.
What I actually need to do is to get the phone number of the user to automatically populate here, and i'm using this script for it javascript:gs.getUser().getRecord().getDisplayValue("phone");
It seems to work if it's not in a variable set. How can i get this to work for a variable that is in a variable set?
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 08:33 AM
This may not be most efficient way to do this but it works if you put this in the default value
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
‎08-31-2022 08:33 AM
This may not be most efficient way to do this but it works if you put this in the default value
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
‎09-01-2022 04:05 AM
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2022 04:05 AM
thank you