workspace hide/show related item tabs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 11:45 PM
How to hide/show based on condition a related item tab in a workspace.
Any suggestionis appreciated. Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 12:24 AM - edited 06-13-2023 12:24 AM
You can write client script view should be workspace.
function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('state') == 1)
{
g_form.hideRelatedList('related list name');
}
ServiceNow Commnunity MVP -2018 class.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 12:37 AM - edited 06-13-2023 12:40 AM
Hi @servicenow14710 Create an UI Policy and select a condition on which you want to run an UI Policy. Now in Script section check Run Scripts button make it "Run scripts in UI type" All in which add a below code in Execute if True Script Editor
g_form.hideRelatedList('related list name');
and below code in Execute if False Script Editor
g_form.showRelatedList('related list name');
Please mark reply as Helpful/Correct, if applicable.
Thanks,
Siddharam