How to get the related list for a UI action condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2024 05:15 AM
There is a UI action which is on the two related list as they are on the same table. How to restrict it to one related list in serviceNow. We trying to get the related list name on the condition of the UI action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2024 05:28 AM
@Nagasri Please refer to this thread https://www.servicenow.com/community/itsm-forum/can-we-get-the-related-list-sysid-in-ui-action-scrip... and see if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 06:34 AM
Hi @Sandeep Rajput ,
I should add that in UI action condition, I need to restrict visibility based on related list name, the script you have mentioned is used for client side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 01:37 AM
Add in the UI Action condition the following code
&& !RP.getListControl().label.equals('Incidents Fixed By Change')
And replace the 'Incidents Fixed By Change'' with the name of the related list on which you DO NOT want the button to be shown.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2024 10:01 AM
This was exactly what I was looking for. Thank you!