Database view in Related lists

david_legrand
Kilo Sage

Hi community,

Isn't it possible to attach a database view to a table  as a related list?

 

Context:

sn_customerservice_case + database view "u_case_metric" (I made it on global), a simple metric view as all other tables

 

I tried with:

* Configuration "related list", the database view isn't visible

* Relationships without advanced, we can't select the database view as a query from table

* Relationships with advanced and set the database view as my query from, when done, the relationship isn't visible in the related lists.

 

So right now, I'm going to attach a relationship based on metric_instance but that's quite ugly 😕

4 REPLIES 4

valarmathi_kann
ServiceNow Employee
ServiceNow Employee

Hi david,

 

I followed the below link and it works.

https://docs.servicenow.com/bundle/jakarta-platform-user-interface/page/administer/form-administrati...

Please check. find_real_file.png

 

create a new relationship from System Definition > Relationship and give the table name on which the related list should be shown and the view table name.

 

Hope this helps?

Thanks Valarmathi,

 

My questions is more on "Database view", here you used the "table" sys_report, can you do the same with lets say "incident_sla" database view to be added as a related list under the incident? 🙂

Community Alums
Not applicable

Hello David,

Did you ever find a solution to this?  I may be needing to solve this same problem for an unrelated requirement. 

Hello David and Dustin

I recently had some luck with this question.

I needed a related list on a Contact, that showed relationships to Tasks where the Contact was on a related list of the Task and not a direct Contact in a reference field on the Task.

 

I first created a database view between the 2 tables.

I then created a relationship where the PARENT table was the Contact table.

The CURRENT table was the new database view table.

 

I could then add the 'Relationship' table as a related list to the Contact.