How to hide choice in workspace form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2025 07:48 AM
Hi,
I have state field with choices and i want to hide one of the choices from the list, so the agent can't select it manually. UI policy or Client script are not working on Workspace, any idea how it can be done?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2025 08:36 AM
Hi Ankur,
Here is UI policy
Here is in normal view
And here is the workspace view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2025 08:44 AM
@borisarnaut , Client scripts usually do work on workspace, just make sure you specify view.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2025 09:02 AM
Hi,
Here is Client script
Here is in normal view
And here is the workspace view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello @borisarnaut,I had the same issue. Workspace forms load slightly faster than the client script, which causes the problem. I resolved it by adding a setTimeout function to the client script.
Here is an example code:
function onLoad() {
if (g_form.getValue('u_category') !== 'My Category') return;
setTimeout(function () {
var currentState = g_form.getValue('state');
['1', '9', '11'].forEach(function (state) {
if (currentState !== state) {
g_form.removeOption('state', state);
}
});
}, 500);
}
