- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2025 11:20 AM
I've seen several posts like the one below about how ServiceNow parses the from address and matches it to the user table.
I'm unable to identify what script, business rule or inboud action is being used to inital parse the emails' from information.
My goal is to modify this and add an additional step to also look in the Notification Devices table for the non matched email to bring over the correct sn user id.
Currently, we are getting our User Information from HR, which on some records, may not have the current/correct email address.
Example; Mary Joe is an HR person for our Company B. She is using that companies credentials instead of using her employment company (Company A).
Does anyone have examples of doing this or can you lead me to where the OOB rule is.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 07:21 AM - edited 03-24-2025 07:22 AM
Thank you all for your comments and suggestions.
I was able to finally get this working. So if anyone else needs to do this, here are the steps i was finally able to put together form everyone's suggestions.
1. Created a Custom "Alias" table, with columns for User (reference) and alias email (string).
**Found that the OOB "Notification Devices" table was replacing the alias email entry with the corresponding user table email address, even if I added another "Method" selection.
2. Created a before insert and update BR to update the email record's User_ID and user fields.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var currEmail = current.user;
var fndAlias = new GlideRecord("Enter Custom Table Name here");
fndAlias.addQuery('u_alias_email',currEmail);
fndAlias.query();
while(fndAlias.next()){
//This updates the email with the desired results.
current.user_id = fndAlias.u_snow_user;
current.user = fndAlias.u_snow_user;
current.update();
}
//THis is key to reprocess the email with alias. If not included email will not process.
gs.eventQueue ("email.read", current, current.sys_id, current.user_id);
})(current, previous);
You might wonder why I'm doing a Before on Insert and Update. I first tried using only Insert as true, but I couldn't get the email to update. Then chose Update is true, and got the email to update but reprocessing didn't always add the user name to the corresponding ticket created. So finally, did the combo of both and Viola! Success.
This was really import for validating existing and new inbound Flow's in my lower environments when i pull sample emails collected from production. Only having one or the other set as true, didn't allow for testing having a user email sub prod directly. Also helpful hint. I copied by "Final" catch all inbound flow to include my sub environment email address, which isn't included in my production ones.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2025 02:06 PM
Hi,
The code you're after isn't accessible to us to modify or view.
However, you could create a low order inbound action that checks if the email is being processed as a guest user, and then try to see if you can find the sender email in the notification device table. If yes, update the email record "user id" field to the user, and set the email to received, then create an email.read event to reprocess the email. This way the email is reprocessed under the correct user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 09:24 AM
OK that makes sense. An additional question.
We have a mixture of Inbound Flows and Inbound actions.
My understanding is that Inbound Flows will fire first before inbound actions.
So should i create both or just a Flow inbound.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 10:49 AM
Hi @EricG ,
Correct, From the docs it reads
Note: Inbound email flows take priority over inbound email actions. If you create flows with inbound email triggers, emails are first processed by the inbound email triggers before they are processed by inbound email actions.
Inbound email actions
Just Inbound Flow should be enough.
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 04:52 AM - edited 03-04-2025 06:42 AM
Thanks, that is what I figured. I've created an inbound flow to look for emails where the User ID field is empty, the Look Up record in the Notification Device table to match either the From email field or User field, and return the Notification Device User (set the don't fail on error so that if no match found it sets to guest).
I can Test run this in my lower environments, however, exporting emails from PROD and reprocessing doesn't trigger this.
Any help on Testing would be great. I have reached out to my HR group to have them send test emails to the lower environment, but I'm still waiting.