Creating a database view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 07:55 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 08:12 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 08:24 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 10:10 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 10:24 AM
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