- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 10:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 10:41 AM
The sys_email table uses a Document ID field(s) to relate back to records, not a direct relationship. So you will need to create a user defined related list:
Creating Defined Related Lists - ServiceNow Wiki
1. Go to System Definition\Relationships and click New
2. Name what you want to call this related list in the Name field- example "Email Log"
3. In applies to table choose incident - or if you want this to all tasks you can choose task
4. In queries from table choose Email
5. In the query with script field, paste in:
(function refineQuery(current, parent) {
current.addQuery("target_table", parent.sys_class_name);
current.addQuery("instance", parent.sys_id);
})(current, parent);
6. Click Submit.
7. Go to your incident form, configure related lists, and add "Email Log" or whatever you called the relationship in step 2 above.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2024 06:56 PM
Hi Sairam,
If you're using the same conditions:
current.addQuery("target_table", parent.sys_class_name);
current.addQuery("instance", parent.sys_id);
Check to make sure that 'target_table' and 'instance' on the incoming received email record are being set to the target record you are currently viewing. If that is all correct, then you might want to check permissions (ACLs) on the sys_email table to be sure users have rights to read the received email records.
Good luck,
-Brian