Table API - Get Child Table Fields

mattp
Tera Contributor

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!

1 ACCEPTED SOLUTION

srinivasthelu
Tera Guru

Hi Matt,



You might want to give a try with this.



https://instnace.service-now.com/api/now/table/cmdb_ci?sysparm_fields=ref_cmdb_ci_server.classificat...




The idea here is, you can pass the field names of specific tables if you know the already to see the values


View solution in original post

9 REPLIES 9

thanks, that works! sysparm_fields=ref_cmdb_ci_server.classification was the key. Just so I understand, where does the 'ref_' beefore cmdb_ci come from, or why is it needed?


Hi Matt,



Glad that helped :-).



"ref_ " is to let the system know that you are looking for fields of extended tables. This feature is added(I think)with Geneva and comes in handy in scenarios like this.


Hi Srinivas,



I have a similar requirement but this link is not working.


Can you help me out?


rajeevlochan82
Mega Guru

Good Information Srinivas !!


rajeevlochan82
Mega Guru

Hi Rishi,



Thats a sample link posted by Sri. You need to replace the instance name with your instance name and your child field.