Record Producer/Variable set default value not showing

muhammad4
Tera Contributor

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?

1 ACCEPTED SOLUTION

Akif_Shah
Kilo Sage
Kilo Sage

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;

View solution in original post

3 REPLIES 3

Akif_Shah
Kilo Sage
Kilo Sage

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;

thank you

 

thank you