get columns in incident_sla using Table API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 03:04 AM
I am using sys_db_view to get sysid of incident_sla view, then I am using sys_db_view_table with view=sysid to get tables in view which are incident and task_sla. Now to get columns used in view for these tables I am using sys_db_view_table_field and giving view_table as sysid of table but it is empty.
The above procedure works well for custom made view but is not giving columns detail for incident_sla, please help me understand why sys_db_view_table_field doesnt have info of columns in tables used to create view and how to get them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 03:16 AM
database view just joins 2 or more table and is not an actual table in "sys_db_object"
But I was able to get correct count when I used table API on incident_sla
Incident -> Urgency -> 1 High (Total 20 Count)
API Gave 20 count
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 03:35 AM
I am looking for schema for columns used in incident_sla, for example for tables we can get it using sys_dictionary, how to get it for incident_sla? What does it mean if sys_db_view_table_field is empty for sysid of incident and task_sla tables with sysid of incident_sla view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 03:43 AM
you won't find the fields in sys_dictionary as it's not an actual table.
you can use the table API on that database view table without any query and see the fields
That's what I used and then applied the query for the urgency
The fields look like this prefix_columnName
Example: inc is the prefix and urgency is the column
So I used inc_urgency=1 in the query in table API
Similarly taskslatable_original_breach_time -> taskslatable is the prefix and original_breach_time is the column
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 07:44 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader