The database view that joins the task table and sys_email table is not working as expected.

imran rasheed
Tera Contributor

I created a database view that joins the task table and the sys_email table.

imranrasheed_0-1693396393959.png

But when I try to view, it doesn't show any records. What could be the reason?

13 REPLIES 13

Maik Skoddow
Tera Patron
Tera Patron

Hi @imran rasheed 

the "Instance" field on the sys_email table is of type "Document ID" and not of type "Reference" and thus need more configuration.

Please see the following knowledge article for more information: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0952022

Maik

Hello Maik,

I went through the article and tried with this where clause tsk_sys_id = eml_instance && eml_instance_table = 'incident'. But it shows the below error

imranrasheed_1-1693404760252.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@imran rasheed 

I won't recommend using sys_email table as it's OOB system table

Did you add the required view fields under those view tables

Also try to use prefix which is 3 or less character in length for both the tables

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur, 

Thanks for your reply.  I mentioned the View fields in both the tables. In sys_email with recipients field and in task table with ticket number. And also tried changing the prefix to tsk and em. Still doesn't show any result. 

Reason why I am using the sys email table is that we need to pull a report on tickets created using inbound email whereas with a specific recipient email address.