We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Display email along with name on ServiceNow Popup

AmanPratapS7233
Tera Expert

Hi All,

 

When I try to search for a user, it shows only names and this creates an issue if we have users with same names. 

To resolve this, I want to use emails along with names as emails are unique. 

 

Can you guide me on how to achieve this ?

 

Thanks

d88d71cc-e8e1-435c-beea-895cecb9ab38.png

AmanPratapS7233_0-1782803927611.png

 

16 REPLIES 16

glideFather
Tera Patron

ahoy @AmanPratapS7233,

 

when you say popup, what are you talking about?

 

What field is it (Assigned to or another?) and where it is - Portal or Workspace...?

 

This could maybe be controlled from system dictionary's attributes, my PDI is too slow to try at this moment :// 

GlideFather_0-1782807115367.png

 


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

This is for classic view comments and worknotes in incidents

yashkamde
Mega Sage

Hello @AmanPratapS7233 ,

 

Navigate to sys_dictionary :

 

filter out :

Screenshot 2026-06-30 175450.png

 

It will work showing up emails :

Screenshot 2026-06-30 175034.png

 

If my response helped mark as helpful and accept the solution.

 

@yashkamde - I don't understand. Can you explain in a bit detail ?

sorry I forgot to mention !!

 

add this script in your calculated value script :

if (current.first_name.nil() && current.last_name.nil() && !current.name.nil()) {
    var names = current.name.toString().split(" ");
    if (names.length > 1) {
        current.first_name = names[0];
        names.shift();
        current.last_name = names.join(" ");
    } else
        current.last_name = names[0];
}

var displayName;
if (current.first_name.nil()) {
    displayName = current.last_name;
} else {
    displayName = current.first_name + ' ' + current.last_name;
}

if (gs.getSession().isInteractive()) {
    if (gs.action.getGlideURI() != "" && gs.action.getGlideURI().getMap() != '') {
        if (gs.action.getGlideURI().toString().startsWith('api/now/form/mention/record/')) {
            if (!current.email.nil()) {
                displayName = current.email; // show email only, replacing the name entirely
            }
        }
    }
}

displayName;

 

If my response helped mark as helpful and accept the solution.