- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 06:50 PM
Hi Experts,
Good day!
I just want to ask your expert opinion on how to control show/hide of related list using UI policy.
I created UI policy that should control the show/hide of Related List name (task_sla.task) using below conditions and
with the g_user that will check the user role based on below specific roles
I would appreciate any help help regarding this matter.
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 08:33 PM
Hi @Michael Galang you dont need to pass sysid under hasRole. You need to use like below
Refer documentation: https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/client/c_GlideUserAPI#r_GlideUs...
var isItil = g_user.hasRole('itil');
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 07:22 PM - edited 03-26-2024 07:23 PM
- Instead of Parent_Table_Name We have to use the ‘Related list’ field value from the list control
Try to Log a message to see if your conditions are met !
Go to the form where the related list is present.
Right-click to open the column context menu on the related list.
Select Configure > List control.
the ‘Related list’ field value from the list control. (Suppose - "Related_list_value" is the value)
Now the statement should be g_form.showRelatedList('Related_list_value');
I hope this helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 05:55 AM
Hi Sohail,
Thank you for your help. It works now. 😀

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 08:33 PM
Hi @Michael Galang you dont need to pass sysid under hasRole. You need to use like below
Refer documentation: https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/client/c_GlideUserAPI#r_GlideUs...
var isItil = g_user.hasRole('itil');
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 05:54 AM
Hi Harish,
It works now. Thank you for your help.