create database view for joining three tables case , casetask and metric instance tables

SrihariB8194828
Tera Contributor

How to add metric instance table , case and case task table in a database view

4 REPLIES 4

Bhavya11
Kilo Patron

Hi @SrihariB8194828 ,

 

Create Database view by view table like case and case task table then join metric instance table [metric_instance] so that you can able to achieve this.

For example :Screenshot 2026-03-17 102231.png

 
 

 

 

 

If this information proves useful, kindly mark it as helpful or accepted solution.

Thanks,
BK

Ankur Bawiskar
Tera Patron

@SrihariB8194828 

so what did you start and where are you stuck?

share screenshots

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

VSAmbicaB
Tera Contributor

Step1: system definitionàdatabase viewànew

Step2: add the Name and save it the view table related list will be open

Step3: In view table add your 3 tables case, case task and metric instance one after the another by filling appropriate where clause example given below  and update it. Then use it depend on your need.

 

 

 

 

  • Step1a:

Table: case [case]

Variable Prefix: case

Order: 100

Where clause:  case_sys_id = journal_element_id (here case is joining with another table)

  • Step1b:

Table: case task[sn_hr_core_task]

Variable Prefix: casetask

Order:200

Where clause: casetask_sys_id = journal_element_id(case is joining with another table)

  • Step1c:

Table: Metric instance

Variable Prefix: mi

Order: 300

Where clause:  mi_id = journal_element_id (here metric instance is joining with another table)

Hope it will be useful

 

VSAmbicaB
Tera Contributor

Step1: system definition-->database view-->new

Step2: add the Name and save it the view table related list will be open

Step3: In view table add your 3 tables case, case task and metric instance one after the another by filling appropriate where clause example given below  and update it. Then use it depend on your need.

Screenshot 2026-03-17 115208.png

 

  • Step3a:

Table: case [case]

Variable Prefix: case

Order: 100

Where clause:  case_sys_id = journal_element_id (here case is joining with another table)

  • Step3b:

Table: case task[sn_hr_core_task]

Variable Prefix: casetask

Order:200

Where clause: casetask_sys_id = journal_element_id(case is joining with another table)

  • Step3c:

Table: Metric instance

Variable Prefix: mi

Order: 300

Where clause:  mi_id = journal_element_id (here metric instance is joining with another table)

Hope it will be useful