Triggering an email Notification when a record is 'inserted' into a Database View

Wayne Richmond
Tera Guru

I've tried to create an email Notification that triggers when a record is inserted into a Database View, however, it doesn't seem to work. I'm wondering if this is because it's a Database View or whether I'm doing something wrong.

The Database View I'm using is the out of the box 'task_survey_detail'. The condition for my Notification is as follows:

find_real_file.png

When I navigate to the task_survey_detail_list table and run that condition I get results:

find_real_file.png

Does anyone have any ideas?

The requirement for me to do this is that Team Leads what to receive an email when a low score is given on our customer satisfaction survey. If there's an alternative way to achieve this I'd be interested to hear it.

6 REPLIES 6

vinitha3
Tera Guru

Hi,



Database Views are stored in the "Database View" table (sys_db_view).


Create your own unique event:   e.g. dbview_updated (see Register an event )



You can then create an email notification when this event fires, looking for the specific View you wish.   You should be able to accomplish it by using this similar example:   Notification example: priority 1 incident update



Thanks,


Vinitha.K


Hi



I'm not sure how this would work. You say that Database Views views are stored in the sys_db_view table and that I should create an event when this table is updated, however, nothing gets updated in those tables, that's just where the joins (View Tables) are stored.


Mujtaba Amin Bh
Mega Guru

You should create a notification on table survey_response and not on a database view. It is important to understand that records are inserted in tables and not in database views.


Thanks Majtaba, that's exactly what I thought with regards to the records not being inserted into a Database View.



I don't think I can use the survey_response table because I want to be able to link to the ticket that generated the survey. This only exists on the task_survey table, hence the requirement for the Database View to combine these tables.