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.

How to link tables in database view using reference field display value

runfast
Kilo Guru

i am trying to create a database view using reference field display value as condition (where clause).

Example:
I need to create a database view on Hardware table (cmdb_ci_hardware) and installed software (cmdb_sam_sam_sw_install) table
where cmdb_ci_hardware.name = cmdb_sam_sam_sw_install.installed_on (installed_on is reference field on the hardware table)

Here is what I am trying in the database view:

cmdb_ci_hardware (prefix=hd), order 100, where clause Empty
cmdb_sam_sam_sw_install (prefix=sam), order 200, where clause = hd_name = sam_installed_on

I also tried under the where clause: hd_name = sam_cmdb_sam_sam_sw_install.installed_on

it returns zero records. I have already confirmed that there are software installed servers

Any guidance OR directions greatly appreciated.

thanks
Alex

2 REPLIES 2

Carlos Camacho
Mega Sage
Mega Sage

Hi Alex, 

If one table has a reference field, it is possible to use what we call Dot Walking to retrieve records joining these tables. 

Please refer to this THREAD for examples. 

________________________

Carlos Camacho
https://www.linkedin.com/in/camachojunior

 

ServiceNow Tec2
Mega Sage
This has been resolved by ServiceNow Technical Support. Please refer to KB1006377 for more information.