Creating a database view

MStritt
Tera Guru

I'm trying to create a database view between 2 tables, and am having problems creating the where clause. Whatever I enter as a clause for either table, I'm not seeing any records when I click on 'try it' under Related Links. I would assume I'd see all cases and provisional records. I guess I'm not totally sure how to configure the clause. How to link the tables.

 

Tables:

sn_customerservice_case

sn_customerservice_provisioning_request

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@MStritt 

you need to have either a field in 2nd table which refers 1st table OR have some field which holds common information between those

if either of the above satisfies then database view will work

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thanks Ankur.

There are 2 reference fields on the Provisioning table that are also on the case table.

assignment_group

assigned_to

 

Would it just be a clause on the provisioning table? Or do you need to add a clause for both? How would I format the clause?

 

Variable prefixes:

Case table (order 100)= cs

Provisioning table (order 200)= pro

 

Community Alums
Not applicable

Hi @MStritt ,

Please try 

cs_assignment_group = pro_assignment_group

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

Hi Sarthak!

 

I've added that clause on the provisioning table in the database view. I'm now seeing records when I click on Try it. But, when I create a report with the table as Case provisioning requests, I'm not getting any records even if I just add 1 condition of Active (cs_active) is true. 

 

Cannot generate the report. No matching records