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.

Related List Hierarchy not visible

vivekghildi
Tera Contributor

I'm trying to display a hierarchy like structure in the case form so that the end user can drill down and navigate to the product and finally choose the product for which the case is being created. 

vivekghildi_0-1763014942093.png

This is the hierarchy of product models that I have created - 

vivekghildi_1-1763015121983.png

 

To my surprise, blank window is being displayed. Can we display hierarchy in some other way?

Is it at all achievable through the OOTB 'Field Name'?

 

11 REPLIES 11

SovanBanerjee
Tera Expert

Hi,

 

The "Field Name" type field, often used in conjunction with a "Table Name" type field, dynamically displays fields available on a selected table, including those inherited through table extension (hierarchy).

 

Displaying Hierarchical Selection in Reference Fields (Customization):
 
While the "Field Name" field itself shows inherited fields, if you need to display a hierarchical selection of records within a reference field (e.g., selecting users from an organizational hierarchy), this typically requires custom development. This often involves:
  • Service Portal Widgets: 
    Creating a custom Service Portal widget to present the hierarchical data with features like checkboxes for multi-selection.
  • Script Includes: 
    Utilizing Script Includes to manage the data retrieval and processing for the hierarchical display.
  • Field Attributes: 
    Using attributes like fieldChoicesScript on the reference field's dictionary entry to integrate the custom logic from the Script Include.
     
    So, as per your requirement you should go for the reference type fields and make it dependent on "Product" field.
    Please mark the answer correct/helpful accordingly.

     

    Regards,
    Sovan

So, as per your requirement you should go for the reference type fields and make it dependent on "Product" field.

 

If I move ahead with this, will I not see the other products? Or I'll still be seeing the entire list of products?

So if that will depend on the product then it will only show the records which are related to that product only. 

If you don't select any records for the product then it will show all the records.

vivekghildi_0-1763035272990.png

The dependent field seems to be not working as before when 'Reference' field type is being used

Add the column name of the product to the dependent and check.

 

If that doesn't work then you can create one on change client script and fetch the record related to the product using script include and push all the records to the new reference field.