Display email along with name on ServiceNow Popup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
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 ://
Where the rules are real, you'll find me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
This is for classic view comments and worknotes in incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello @AmanPratapS7233 ,
Navigate to sys_dictionary :
filter out :
It will work showing up emails :
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
@yashkamde - I don't understand. Can you explain in a bit detail ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
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.