Creating a Database View

MStritt
Tera Guru

I'm looking to create reports against our Survey table (ast_assessment_instance). When a Case gets closed, we send out a survey. We have a Related List for the Assessment/Survey table on the Case. I want to find out how many surveys we are sending/creating over a period of time, and need to only show surveys that were sent on cases where the Product Family was a specific value. I assume I need to create a Database View between the Case table and Survey table, but not sure how to configure the 'where clause'.

1 ACCEPTED SOLUTION

Anks26
Kilo Sage

Hey,

Assuming the table is 'asmt_assessment_instance' logically you need to find a relationship between the 2 table you would like to find a relation and from what I can see it is the case on sn_customerservice_case and trigger id on asmt_assessment_instance. so you would join these fields in the where clause. so you could do it like below. 

Anks26_0-1683761210275.png


Hope it helps.

Thanks

Anks

View solution in original post

3 REPLIES 3

Bert_c1
Kilo Patron

Hi,

 

You can go here:

https://docs.servicenow.com/search?q=Create%20a%20database%20view

and review the documentation on creating a database view. You can also review existing OOB database views in your instance on how to relate records in different tables.

 

I don't have the 'ast_assessment_instance' table in my instance to review. I do find 'asmt_assessment_instance' table, that has Reference fields to other tables, and used in 'where' clauses.

Anks26
Kilo Sage

Hey,

Assuming the table is 'asmt_assessment_instance' logically you need to find a relationship between the 2 table you would like to find a relation and from what I can see it is the case on sn_customerservice_case and trigger id on asmt_assessment_instance. so you would join these fields in the where clause. so you could do it like below. 

Anks26_0-1683761210275.png


Hope it helps.

Thanks

Anks

Fantastic. Thanks!