Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Sample Database Views to helper table and metric_instance

Marsha Clark
Tera Contributor

Today in PA Academy we discussed using Database Views to join regular tables to other places we need to gather data. Here are a couple of examples which work in my implementation.

 

Join Incident/Task to custom table (the table is used to accommodate a very complex organizational structure using Assignment Group's Manager's Department):

MarshaClark_0-1712176340817.png

This allows me to breakdown data by various levels of the org structure. Moreover, columns have been reduced as much as possible to enable most report_users to create their own reports without significant confusion from the middle four tables.

 

Join sc_task to metric_instance and metric_definition (this allowed me to create an indicator and breakdowns for a CSAT score which is based entirely on survey data).

MarshaClark_1-1712176580485.png

 

While we should always question if we truly need a Database View, sometimes it just can't be prevented. These two examples have made life significantly easier for the strategic user base in my organization.

 

@Adam Stout thanks for taking my question today.

1 REPLY 1

SanjivMeher
Mega Patron
Mega Patron

You dont need to have task table, since incident is already a child table of task in the first view that you created.

You also dont need to join user, group, department. They are accessible via dot walk in a report.

 

In the 2nd database view as well, you dont need task, since sc_task is a child of task table.


Please mark this response as correct or helpful if it assisted you with your question.