Make a database view between incident and sys_email table

nadia78
Giga Contributor

Hi everybody, 

I am trying to make a report from two or three tables.

So I did a "database view", the thing is that the field I want to map with another is a "Document ID".

I want to make a database view from "incident" table and "sys_email" table to get back the number of the incident and the date of the email notification.

I wrote this "where clause" :

email_target (from sys_email table) CONTAINS inc_number (from incident table)

The notifications are sent to user-group. I want to get back the "created" field and link it with each incident .

Can anybody give me an idea about the way to do it. 

Best regards

1 ACCEPTED SOLUTION

Hello Santhana, I tried this : sys_email_log emailog.message_id=email.sys_id exactly, this is the field called "name" I need for the report The instance displays an error : unknown column

View solution in original post

11 REPLIES 11

Service_RNow
Mega Sage

HI,

Check this website. Maybe you will find some interesting information.

https://community.servicenow.com/community?id=community_question&sys_id=4cca836ddb5cdbc01dcaf3231f96...

http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

Please mark reply as Helpful/Correct, if applicable. Thanks!

Shashi Bhushan
Kilo Guru

Please refer the below image and make changes accordingly:

Where clause for incident : email_instance=inc_sys_id

find_real_file.png

nadia78
Giga Contributor
Hi everybody, Thank you for your anwsers, I ALSO have to get back the name of the "Notification" to finish my report. I add a third table on the database view (notification) : Table prefix Where clause incident inc sys_email email email.instance=inc.sys_id sysevent_email_action notif notif.collection=email.instance I need the "name" field of the notification table to my report, can anybody please have a solution or a way, Best regards

Santhana Rajhan
Mega Sage

 

This worked for me
inc order 100
eml order 200
where clause: inc.sys_id=eml.instance
left join for sys_email table true.

 

find_real_file.png

View

find_real_file.png

Its actually in the 

Table: syslog_email

Source: - is the email sys_id

Message - contains the notification..

Join this table