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.

Database view with User and Computer tables

Yassine6
Tera Guru

Hi there!
We need to have a database view of all users with or without computers assigned to them (not personal equipment (so we need to filter out the personal equipment class as personal equipment table is a child of computer table)).
To do this, we joined user table with computer table, with a left join (we tried both for user and computer tables), and it didn't work.

Do you have any idea how to do this?


Thanks!
Yassine

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

This should show you all of the users, and records from the computer table that are not on the PC extended table:

BradBowman_0-1732708093437.png

usr_sys_id=comp_assigned_to&&comp_sys_class_name!='cmdb_ci_computer'

 

View solution in original post

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

This should show you all of the users, and records from the computer table that are not on the PC extended table:

BradBowman_0-1732708093437.png

usr_sys_id=comp_assigned_to&&comp_sys_class_name!='cmdb_ci_computer'

 

Thanks Brad, it worked!

Indeed, I only wanted the computers for cmdb_ci_computer table, so I remove the "!" and it worked perfectly.

You are welcome!