Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Related list should show fields based on Views

rBh
Tera Contributor

Hello Team,

 

We have a custom table called ITDR, which currently contains 6–7 child custom tables added as embedded lists in the PPM tool.

 

(Due to custom table licensing restrictions, our client has asked us to reduce the number of custom tables. To address this, we have merged the child tables into a single custom table by introducing a Type field that identifies the original table. Based on the selected Type, we dynamically display the relevant fields on the form)

 

However, we are facing a challenge with the embedded lists. Previously, each child table had its own embedded list with a dedicated set of columns for users to enter information. Now that all the child tables have been merged into a single table, all embedded lists point to the same table.

Is there a way in ServiceNow to configure different views or column layouts for each embedded list (or related list) even though they all reference the same underlying table? In other words, can each embedded list display a different set of columns based on the corresponding Type?

Any suggestions or best practices would be greatly appreciated.

 

rBh_0-1783347025875.png

 

rBh_1-1783347364361.pngrBh_2-1783347414310.png

 

In servicenow please refer below screenshot

 

rBh_3-1783347708327.png

 

Thanks,

Bhavana

 

 

 

 

 

1 ACCEPTED SOLUTION

@rBh 

you can have multiple related lists but each will have same child table

There also you can't set the list view dynamically based on parent field i.e. Type

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

glideFather
Tera Patron

ahoy @BhavA,

 

could you review your screenshots? They are either some super old version of ServiceNow or some other tool, I remember ServiceNow from London-ish and it already looked way better and modern.

 

Please check that you attached correct files


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

rBh
Tera Contributor

Hello,

 

First 3 screenshots are from PPM Tool and last one is from service-now ( we are migrating from PPM to Servicenow ) as part of it we are creating custom tables in Servicenow.

ahoy @rBh,

 

I am not sure if I understand correctly but what you can try is to have an onLoad client script that would be hiding/displaying related list according to the selected value in Type field.

 

E.g. field Type = A, Related list A1 and A2 is displayed; Type = B, Related list B1 and B2 is displayed, etc...

 

To achieve that you can use this method, I am not familiar with the values of your custom field, but this is just an example that you would need to polish to get desired outcome.

 

Given there are 4 related lists:

var typeField = g_form.getValue('u_type'); //value from your custom field

if (typeField = 'value_1') {

g_form.hideRelatedList("related_list_1_name"); //Hiding RL 1
g_form.hideRelatedList("related_list_2_name"); //Hiding RL 2
// RL 3 and 4 remain visible 

} else if (typeField = 'value_2'){

g_form.hideRelatedList("related_list_3_name"); //Hiding RL 3
g_form.hideRelatedList("related_list_4_name"); //Hiding RL 4
// RL 1 and 2 remain visible 

} else {

//some other logics

}

 


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

Ankur Bawiskar
Tera Patron

@rBh 

No that's not possible.

1 embedded list can have multiple list views but you can't tell embedded list to use List view 1 for Type - A, List view 2 for Type B etc

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader