Hide related list for other users and should only be visible to caller of incident record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 11:35 AM - edited 12-30-2022 10:41 AM
Let's say, I have a related list in incident form but I only want that list to be shown only for the user who is in 'Assigned To' field of that incident and list is hidden for every other user.
How many ways we can achieve this and what should be the best approach?
Any help will be appreciated!
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 11:51 AM
Hi,
Easiest and quickest way would be to create a UI policy, and a UI policy related list action, that shows the related list only if the Caller is dynamic Me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 10:40 AM
Could you elaborate this a bit more. So, i can understand better.
And Could you please let me know the alternate ways as well. That would be great.
-Let's not say for caller, I would say a that related list should only be shown to a user who is in assigned_to field and it should be hidden to every other user.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 11:48 AM
Hello,
You may have to utilize the scripting functionality [ OnChange. which should also run onLoad] or Run Scripts in the UI Policy configuration
add your conditions as\
if(g_form.assigned_to!=""&&g_form.assigned_to==g_user.userID())
{
g_form.showRelatedList('related_list_table_name');
}
else{
g_form.hideRelatedList('related_list_table_name');
}
if your query is resolved then hit the thumb icon so as to close the thread.
Thanks
ServiceNow Consultant
United Kingdom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 09:59 PM
UI policy approach seems good over onChange client script. Let me implement this in my business use case and let you guys know about it and accept it as solution.
Appreciate your time!