Which CMDB table to query if I need to extract all CIs irrespective of CI types ?

Avi15
Kilo Contributor

Hi,

I would need to extract all CIs (Irrespective of CI class or category) from my instance through REST call. Which table should I query to get all CIs and their relationships at once ? 

Is it cmdb_ci and cmdb_rel_ci ?

OR

If I need to fetch Application server then I need to provide table name as cmdb_ci_appl ? 

If I need to fetch Database server then I need to provide table name as cmdb_ci_database ?  etc...

 

Please let me know your valuable inputs regarding the same. 

 

Regards,

Avi

6 REPLIES 6

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

Do a query to CMDB_CI table and then use class field to filter those.


So what we do is just pass a query as below:

find_real_file.png

 

Thanks,
Ashutosh

Dhananjay Pawar
Kilo Sage

Hi,

Its CMDB_CI which holds all CI records.

Thanks,

Dhananjay.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please use what is suggested by Ashutosh

You need to give the query which involves the class name you required

cmdb_ci_printer or cmdb_ci_appl etc

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Avi15
Kilo Contributor

Thanks for your replies. That is Ok if I am interested for one such Class / Category right ?

What if I need to export all CIs in ServiceNow with some specific columns ? Is there a way to achieve it ?

Because what I saw is if I just query cmdb_ci table, then very few columns are being extracted, probably because of all other tables are getting extended from cmdb_ci table. 

 

Regards,

Avi