How to get referencing table of given table using REST API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2023 03:27 AM
Hi
I have a case in which I need to pull the children tables (referencing tables) of a given table using an API. ServiceNow has this mechanism in UI (screenshot attached), I need similar thing through APIs.
Appreciate your help!!
- Labels:
-
Architect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 10:28 PM
Hey, Thanks for your answer.
But, this is not what I am looking for. This API tells about table extensions only. Also, this doesn't belong to REST API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 12:50 PM
Hi,
You would need to build your own scripted rest web service to fulfill the data needs for this use case.
A quick googling gives you this example of a tool that uses the getTableExtension() function from the
GlideTableHierarchy API. This might give you some ideas on how to proceed with your own code.
BR, Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 01:23 PM
I traced the code that is triggered when you open the Entity Relationship Diagram. It points to this Script Include on the system:
ERDProcessor /sys_script_include.do?sys_id=5de8f42137130000dadaa3549dbe5daa
"This script defines an AJAX processor that returns the GraphML (for Schema Map V3) of a specified database table.
Parameters define what is rendered.
The output also contains client-side
javascript for navigation and browsing."
This could be helpful if you end up building your own API. Just parse the needed information as text to output.
BR, Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 08:43 PM
@JC Moller ty very much for posting this. I will be leveraging this in my solution to build a graph for a scoped app, here is the solution if you are interested to know further
anilvaranasi/creativeworks: Contains application called awesomenowcreativeworks