- 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 01:18 AM
Hi,
Why don't you just enable "create new users if user is not registered in servicenow" in the email properties?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 01:24 AM
We did enabled that its more complex like any email that receives creating a record again we enable trusted domain property with this only mention domain emails are getting processed. so final thought is to create users from the inbound action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 01:29 AM
Okay.
Then you have to use email.from in the name as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 06:59 PM
slight correction to IF: (name == "guest")

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 01:12 AM
Hi Irfan,
Comments from Asifnoor should work well. In case you still will to follow primitve/old school method you can use below.
var getnameofuser;
var getmailfrom=email.from;
var getname=new GlideRecord('sys_user');
getname.addQuery('email',getmailfrom);
getname.query();
if(getname.next())
{getnameofuser=getname.name; //gives you name
}