Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to show hierarchy/hierarchical structure from a table?

vivekghildi
Tera Contributor

Suppose I have created a custom field called 'Component with Issue'.

vivekghildi_0-1763044800741.png

 

In this field, I want to show the hierarchy of the product models to appear such that the end user can drill down to the actual component in which the issue is present. What is the best way to do this?

For example, this is the hierarchy that I want to achieve -

vivekghildi_1-1763044922727.png

Each of the previous product model is linked to the next through 'Model Categories' related tab.

vivekghildi_2-1763044996833.png

 

1 REPLY 1

John Gilmore
Giga Guru

So based on your images there are a couple of things going on that make this work.

First - it appears the Model Categories is likely a separate table containing the categories which can then be tied to the Component records via a reference field. The configuration of the reference field would vary depending on if a Component can only have a single Model Category or can belong to several.

Second, once the Model Categories records are in place and the Components correctly reference them, you could use related lists (or filtered list components) to create the hierarchy display you show. The ability to drill down through the hierarchy is going to be dependent on where the user is viewing the record forms. Look for event mappings to configure where a user is directed when they click on specific links.