- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 03:08 PM
We have a use case where we want to query the cmdb_ci table for specific classes, and return fields from those classes that aren't on the base cmdb_ci table. An example would be 'kernel_release', which exists on the 'cmdb_ci_linux_server' table, but not on cmdb_ci. Is there a way to return the field 'kernel_release' when it exists when querying cmdb_ci over the table API?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 03:36 PM
Hi Matt,
You might want to give a try with this.
The idea here is, you can pass the field names of specific tables if you know the already to see the values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 03:22 PM
I do not think so as Table API is out of box , so unless you write some custome web-service , there does not seem to any way to retrieve it from table api if the field does not directly exist in a table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 04:15 PM
I've put a little though into this for a use case I haven't gotten to yet, and didn't find an easy solution on the shelf.
I think... if you know the end class tables are of interest, you could do something like query each of those tables for the more specific droids you are looking for, then use an exclude filter in cmdb_ci to exclude the records you should already have based on a filter.
Apparently NOT IN works since sys_class_name is a pick list field.
.../api/now/table/cmdb_ci?sysparm_query=sys_class_nameNOT%20INcmdb_ci_server,cmdb_ci_hardware,cmdb_ci_computer&sysparm_fields=sys_class_name&sysparm_limit=1000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 03:36 PM
Hi Matt,
You might want to give a try with this.
The idea here is, you can pass the field names of specific tables if you know the already to see the values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2017 08:43 AM
Perfect. Thank you Srinivas. I was looking for exactly that and didn't find it the other day.