- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 12:47 AM
Hi,
When i receive the email to servicenow i want to get the name of the sender.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 01:17 AM
In such case, you get guest.
var name = gs.getUser().getUserByID(email.from_sys_id).getDisplayName();
if(name="guest") {
name = email.from;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 12:54 AM
you can get it like this
gs.getUser().getUserByID(email.from_sys_id).getDisplayName();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 01:14 AM
I get emails whose user record is not available in servicenow
In such case how can i get the name ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 01:17 AM
In such case, you get guest.
var name = gs.getUser().getUserByID(email.from_sys_id).getDisplayName();
if(name="guest") {
name = email.from;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 01:17 AM
Then the name will give the actual from email address (if the user is not registered in SN). If he is registered user, you will get the actual name.