email is not populating in dictionary default value

Deepthi13
Tera Expert

hi team, i want to populate email in string field from assigned_to email, i am trying below script in dictionary default value.. please suggest

var assignedUserEmail = '';
//if (current.assigned_to && current.assigned_to.email) {
assignedUserEmail = current.assigned_to.email;
//}
return assignedUserEmail;

1 REPLY 1

Dom Gattuso
Mega Sage

@Deepthi13 I believe it is having trouble with the dot walking. Please try this: 

 

var assignedUserEmail = '';
if (current.assigned_to) {
        var user = new GlideRecord('sys_user');
        if(user.get(current.assigned_to)){
                if(user.email){
                        assignedUserEmail = user.email;
                }
        }
}