List all tables with superclass sys_import_set_row table

dadada
Kilo Explorer

Hi guys,

I need to list all tables whose superclass is sys_import_set_row table. Currently, I use the following REST query:


https://{instanceName}/api/now/table/sys_db_object?sysparm_query=sys_app_fileISNOTEMPTY&sysparm_display_value=false&sysparm_fields=name,label&super_class.label=Import%20set%20row

which list all direct children of sys_import_set_row table. Lets say, I have tableOne and tableTwo. tableOne extends sys_import_set_row table and tableTwo extends tableOne. I am searching for a query to list both tableOne and tableTwo tables. Is it possible at all?

Thanks in advance,

Martin Marinov

4 REPLIES 4

Mike Allen
Mega Sage

Can you do



super_class.label=Import%20set%20row||super_class.super_class.label=Import%20set%20row


Hi Mike and thank you for your answer,



Unfortunately, no. The response is:



{


  "error": {


      "message": "No Record found",


      "detail": "Records matching query not found. Check query parameter or offset parameter"


  },


  "status": "failure"


}



I've tried to use only "super_class.super_class.label=Import%20set%20row" and this lists tableTwo, but this is not satisfactory result. I am searching for a query that lists all child tables to sys_import_set_row. So, no matter the count of child tables, if there is a coherent


inheritance (tableOne extends sys_import_set_row, tableTwo extends tableOne, tableThree extends tableTwo and etc), I need to list thesetables. Any ideas?



Regards,


Martin Marinov


Can you try this:



TableUtil Script Include has two methods:



getTableExtensions: function () {


  return GlideDBObjectManager.get().getTableExtensions(this.tableName);


  },



  /*


  * Return an array of table extensions, includes base table


  * @return ArrayList


  */


  getAllExtensions: function () {


  return GlideDBObjectManager.get().getAllExtensions(this.tableName);


  },



I did a gs.print(getTableExtensions('task')); and seemed to get close.   Maybe that is what you can do?


adamjgreenberg
ServiceNow Employee
ServiceNow Employee

Martin,



You should be able to get this info from the table sys_db_object.



Looks like some instances use different sys_id's for Import Set Row.



You'll want to navigate to /sys_db_object_list.do and in your filter select "Extends Table" > "is" > "Import Set Row"



Regards,


Adam