Creating a report from multiple tables

MStritt
Tera Guru

Hello,

I need to create a report, that will require data from at least 4 different tables. It was mentioned that I need to use/create a database view. I've never done this. Is this what I need to do? Or is there another way to display data from multiple tables without creating a database view?

11 REPLIES 11

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Reports can contain attributes from direct references to the table defined in the report.  For example the incident table has a caller_id field that is a reference to the sys_user table.  When you define the report you can include columns from caller's user record.  So if the table you are wanting to report against has direct relationships to these other tables you may be OK without a database view.

But database views are required when there is no direct reference and the data needs to be joined via "where" clause.

Details on how to create database views can be found on Docs:

https://docs.servicenow.com/bundle/orlando-platform-administration/page/use/reporting/task/t_CreateA...

 

Please mark this post as helpful or the correct answer to your question if applicable so other viewing may benefit.

Adam Stout
ServiceNow Employee
ServiceNow Employee

What data do you need?  Views join data but do not union data.  If you are just joining, you should be able to dot walk (unless you are going through multiple M2M relationships but then your report will be odd anyway of if you have a doc id field).

If you need to union, you need to rely on the extension model and report on a common base class.

Hi Adam,

Here are the conditions for the report.

find_real_file.png

 

There are 23 columns to the report. I can configure almost all of the columns by dot walking. Most of the fields are on the Case table and Account table. The only field/column I'm not getting a value for, is the State/Province (column name = state). It's actually from a related list on the Account (Locations) and is on the Location [cmn_location] table.

find_real_file.png

 

find_real_file.png

Adam Stout
ServiceNow Employee
ServiceNow Employee

Is this a related list or just a reference?  Isn't this just account.location.state from the customerservice_case table?