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

I want to fetch all the records from the cmdb_ci table with a certain hostname but host_name column is not a part of the cmdb_ci table. So, is their any way we could do this?

mp31
Tera Contributor

I'm trying to get all the record with a specific hostname but as the host_name column is not part of the cmdb_ci table. So is there any way I could get all the record from various table extending cmdb_ci table  through script.

6 REPLIES 6

Aditya Telideva
ServiceNow Employee
ServiceNow Employee

Although this is not recommended, please go through cmdb_rel_ci table which speaks about all the existing relationships and could be of great help as a starting point


Julian Hoch
ServiceNow Employee
ServiceNow Employee

I don't see why not. If you call GlideRecord.getValue("<field>") with a field that doesn't exist, it treats it as empty. So you should be able to either create a filter query directly or loop and filter. What exactly did you try that doesn't work?