Reference to a database view

gabriel_sk
Tera Contributor

Hello team,

I have created a new table where to host a quality review of the incidents created.
Now in the new table's form, I would like to have fields that are referring to a database view I have created (incidents + assessments), is that possible?

Seems it is not possible to create a new column and reference it to the database view (and then using dot walking to add other fields).

Thank you so much:)

8 REPLIES 8

Hey guys,



Thank you for your replies. After searching around I came to the same conclusion (it is not possible to refer to the DB views)...
Would be interesting to know why the DB views are available in "create new field" under "Form Layout"



Btw still regarding the DB views, is it possible to point to them via "Related List" (creating a new relationship)?



Thank you:)


Hi Gabriel,



Interestingly, if you try to create a new column navigating to the table's dictionary you will not be able to select any database view as the Reference table. This is possible only when we try to create from 'Form Layout' option.



If you want to generate such table combining 2 or more tables and use that in your related list, then I would encourage you to create m2m table. You can not achieve this (showing as Related List) via Database View. For reference you can refer Creating a Many-to-Many Relationship - ServiceNow Wiki.



I hope this helps. Please mark correct/helpful based on impact


Hi gabriel.sk ,



Were you able to have a look at my response? May I know the Status of this thread?


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View


Yifeng Zhang
Mega Expert

While it is not possible to reference directly to the database view, but you can create a related list showing just one record, directly from the databaseview, just like any other related list, the only thing is when you define the relation is not related from sys_id but the sys id with the prefix that you defined when you created the db view.

 

Also even you can only reference directly to tables, but you can still use the databaseview as a reference qualifier, as I found out my self here : 

https://community.servicenow.com/community?id=community_question&sys_id=dca86df8db1c63009d612926ca9619be