Hide section of a form on Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 09:01 PM
Hello Gurus,
I am trying to hide sections on a Requested Item form using g_form.setSectionDisplay("section_name", false). This perfectly works fine on a regular form/view of the platform.
The problem is with the Agent Workspace and is not hiding the section/sections.
Can you please help me understand if g_form.setSectionDisplay is supported on Agent Workspace? Or are there any other alternatives?
Thanks in advance
-Pa
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 09:59 PM
Hi Paul,
g_form.setSectionDisplay should be supported in Agent Workspace. As the Knowledge base links to:
(describes the supported client type scripts and API for Service portal, but same scripts will work for agent workspace).
Alternatively what you can do is set up a new View, without the sections, and via Workspace View Rules apply the view when applicable. This feels like more setup work, but is the No-code/low-code way of doing it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2021 07:03 AM
I've used g_form.setSectionDisplay in the Workspace UI with a UI Policy Run Script set to All. Is there official documentation stating it is not supported?
For fun try a UI Policy, Run Script set to All, I didn't put any conditions in, I just wanted to hide Related Records always, but this can be flipped if using conditions:
Execute if true:
function onCondition() {
g_form.setSectionDisplay('related_records', false);
}
Execute if false:
function onCondition() {
g_form.setSectionDisplay('related_records', false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2021 07:15 AM
You are right Ashley, I will update accordingly.
It should be supported as it is also supported in the Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2021 07:18 AM