The CreatorCon Call for Content is officially open! Get started here.

Database join struggle

Russell Abbott
Kilo Sage

I'm working on a DB join and am struggling.

On the Incident table, I have a 'cmdb_ci' field, for users to select a device name

On a custom table, I just have a list of device names that are updated every Sunday

 

I'm trying to view all Incidents where the cmdb_ci.name is one of the names on my custom table

 

I have added INC (incident) and CID (custom table) with the where clause set to 'inc_cmdb_ci = cid_u_name'

 

With no luck. Do i need to add the cmdb_ci table here as a 3rd table?

 

Any help would be greatly appreciated

 

sc.jpg

 

1 ACCEPTED SOLUTION

Omkar Mone
Mega Sage

The inc_cmdb_ci field will return a sys_id, whereas the cid_u_name field contains the name of the CI, not the sys_id.

To resolve this, you'll need to add another table (e.g., the cmdb_ci table) to match the CI's sys_id with its corresponding name. Then, use the name field from the cmdb_ci table to join with the cid_u_name field in the custom table.

View solution in original post

5 REPLIES 5

The custom table is just a list of names, string, not reference