
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 11:48 AM - edited 02-24-2023 07:20 AM
Is there a way get a tree-like visualization of all groups and their hierarchy?
Or visualize really any type of hierarchy where a record has a reference to a different record on the same table.
i.e. Groups A and B all have the parent Group C. Groups J and K have the parent Group I. And Groups D and I have the parent Group X. ServiceNow would give me a visualization like the following (though obviously not as text):
X
/ \
C I
/ \ / \
A B J K
Glancing at that, I can tell a lot more about the organizational structure than I could following references on records.
Edit: Adam's solution is definitely the lightest lift if you just need something quick. But now another option from San Diego and beyond is the Node map component in UI Builder. Requires a little more logic behind the scenes to support it, but there are a lot of neat customizations you can do with it.
Solved! Go to Solution.
- Labels:
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 12:46 PM
It isn't amazing, but you can take a look at using the UI PAge "generic_hierarchy". It lets you do this by setting some parameters (no need for any custom code). I have used this to create a module to let users explore groups. Alternatively, you use a custom visualization, but I have never had to resort to this as generic_hierarchy met my needs.
Here is a sample link: https://<yourinstance>.service-now.com/generic_hierarchy.do?sysparm_stack=yes&sysparm_attributes=lay...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 12:46 PM
It isn't amazing, but you can take a look at using the UI PAge "generic_hierarchy". It lets you do this by setting some parameters (no need for any custom code). I have used this to create a module to let users explore groups. Alternatively, you use a custom visualization, but I have never had to resort to this as generic_hierarchy met my needs.
Here is a sample link: https://<yourinstance>.service-now.com/generic_hierarchy.do?sysparm_stack=yes&sysparm_attributes=lay...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2019 08:13 AM
That's pretty much exactly what I'm looking for. This is great! Really appreciate it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2021 10:16 AM
Adam, the link you posted is greatly appreciated!
If you're like me, though, you might want to load that link in with the navbar being available. The problem is that Adam's link lacks the navbar as well as lacks URL encoding (which is proper for that sort of link) but when you introduce the navbar URL encoding becomes mandatory, forcing you to convert multiple dozens of characters to URL encoding. If you skip or mess up on any of those character conversions, ServiceNow just gives you the invalid URL screen and you have to start over (unless you wrote down your test URL before loading it).
So, if you're like me, you basically had to battle it out to get the URL encoding just right so that ServiceNow would accept that link converted to a navbar link. So, after all that work, I just wanted to share with you all the link that works. Remove the []'s and the text within them and replace it with the relevant value.
nav_to.do?uri=%2Fgeneric_hierarchy.do%3Fsysparm_attributes%3Dlayout%3Dsugiyama,spacing_x%3D80,spacing_y%3D16,levels%3D[NumberofLevels],description%3Dmanager,baseid%3D[GroupSysID],record%3Dsys_user_group,title%3Dname,parent%3Duparent%26sysparm_stack%3Dyes |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 02:19 PM
A great solution from Adam Stout. Still useful 4 years later.
I created the following UI Action on the Group [sys_user_group] table to make this easier.
Form link: true
Show insert: false
Show update: true
Client: true
Onclick:
viewGroupHierarchy()
Script:
function viewGroupHierarchy() {
var url = '/generic_hierarchy.do';
url += '?sysparm_attributes=layout=sugiyama';
url += ',spacing_x=80,spacing_y=16,levels=2';
url += ',record=sys_user_group';
url += ',title=name';
url += ',description=manager';
url += ',parent=parent';
url += ',baseid=' + g_form.getUniqueValue();
window.open(url, 'group_hierarchy');
}