Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Combining two tables without similarity

amalina
Mega Contributor

Hi,

Is it possible to create a view using two tables without similar column.

I need to combine task & new_call table to get a full list of My request.

Any idea?

Thanks in advance for the help.

12 REPLIES 12

Shishir Srivast
Mega Sage

Hi Amalina,



I don't think it's possible to create database view on two table which do not have common column in between.



Database view always requires the correlating fields. Examples: incident.sys_id -> sys_user.sys_id will not give you any useful data. incident.caller_id -> sys_user.sys_id will give you incidents incl. the full details on the user record of the caller.



database views are just joins of tables.



Reference: http://wiki.servicenow.com/index.php?title=Database_Views#Task_1:_Create_a_Database_View


  Hmm..i think so too..


Thanks for your reply


Shiva Thomas
Kilo Sage

Hi Amalina,



Did you try making your list/report/query on the task table itself?


This table is at the root level, below the call and incident tables.



The query would look like: assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^sys_class_name=incident^ORsys_class_name=new_call^active=true



To use the tasks table for list, simply type task.list in the Filter navigator.


I often filter my work on the task table, to get anything active that is assigned to me.


Hi Shiva,



Yes i want to query a list of task and new call to be listed under My Request list on portal.


I can get the list from task table...but found out that new_call is not isted under task.


That is why i am thinking of a work around.