How to export the metadata of an entity containing the metadata of fields from parent entity as well

ravikku
Kilo Explorer

While exporting an entity metadata (say for example incident) using the REST URI
https://demo005.service-now.com/sys_dictionary_list.do?XML&sysparm_query=name=incident&sysparm_recor...

the response returns the attributes metadata only for the attributes present in incident table. Where as when I export the entity (i.e., incident) data, I get the attributes from "incident" as well as "task" both in the same XML file. This is because "incident" extends from the "task" table.

Is there a way to specify in URL to export incident metadata which also includes the attributes from task as well ?

3 REPLIES 3

Jacob_Andersen
ServiceNow Employee
ServiceNow Employee

sys_dictionary will show you the fields for a particular table, whereas exporting a table itself will give you all of the fields available to it. This is by design.

The simple way to get both incident/task table fields from the sys_dictionary table is to use the following URL instead: https://demo005.service-now.com/sys_dictionary_list.do?sysparm_query=name%3Dincident%5EORname%3Dtask&XML . This URL says to give you both incident and task table dictionary entries.


ravikku
Kilo Explorer

Yes. This is possible but the problem with this approach is it gives column label "Sys Id" two times. One for incident and other for task table. Can we get each column only once without applying any xsl?


Jacob_Andersen
ServiceNow Employee
ServiceNow Employee

You could continue to filter out fields/data using more sysparm_query parameters. If this is not the route that you wish to take, you could create a DB view and then export that information and not use any sysparm_query parameters.

Before we go down this path any further, though, I am curious as to what you're wanting to accomplish here? I think my initial suggestion is the cleanest if you can simply understand that sys_id will return twice (or not at all if we decide to filter out that field).