Need guidance implementing hierarchical Parent → Child structure in UI Builder

Rohitp484
Tera Contributor

Subject: Need guidance implementing hierarchical Parent → Child structure in UI Builder

Hi Everyone,

I have a requirement to implement a hierarchical relationship in ServiceNow UI Builder / Workspace and would appreciate guidance on the best approach.

Table:
asset_services

Requirement:

I need to display records in a hierarchical structure like this:

POS (Parent)
 └── VAS (Child)
      └── TID (Child of VAS)

Relationship Logic:

  1. POS records are top-level parent records.

    • Condition: u_asset_type = POS

  2. VAS records should appear as children of POS.

    • Condition:
      VAS.posassetid = POS.u_id

    • u_asset_type = VAS

  3. TID records should appear as children of VAS.

    • Condition:
      TID.vasassetid = VAS.u_id

    • u_asset_type = TID

Sample expected hierarchy:

POS001
 ├── VAS001
 │     ├── TID001
 │     └── TID002
 │
 └── VAS002
       └── TID003

POS002
 └── VAS003
       └── TID004

Challenge / Questions:

I want to implement this using UI Builder.

Could someone advise:

  1. Is this achievable using only UI Builder components (for example  List View/Table View/Tree component / Data Visualization)?

  2. If yes, what would be the recommended approach?

  3. Would I need a Script Include + Scripted REST API + Data Resource to build the hierarchy?

  4. Since the relationship uses two different linking fields (posassetid and vasassetid) instead of a standard single parent field, what is the best design pattern for this scenario?

Expected output:
+--------+---------------+-------------+-------------+-------------+
| u_id | Name | Asset Type | posassetid | vasassetid |
+--------+---------------+-------------+-------------+-------------+
| POS001 | POS Mumbai | POS | | |
| VAS001 | VAS Airtel | VAS | POS001 | |
| TID001 | TID Machine 1 | TID | | VAS001 |
| TID002 | TID Machine 2 | TID | | VAS001 |
| VAS002 | VAS Jio | VAS | POS001 | |
| TID003 | TID Machine 3 | TID | | VAS002 |
| POS002 | POS Delhi | POS | | |
| VAS003 | VAS Vodafone | VAS | POS002 | |
| TID004 | TID Machine 4 | TID | | VAS003 |
+--------+---------------+-------------+-------------+-------------+

Any suggestions, examples, or recommended implementation approaches would be very helpful.

Thanks in advance!

1 REPLY 1

Tanushree Maiti
Tera Patron

Hi @Rohitp484 

 

Refer this post : Display Interaction → Case → Request → RITM hierarchy as a tree on all 4 record pages in UI Builder 

Build a Transform Data Broker for Knowledge Base Category Hierarchy

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti