- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 08:14 AM
Hi everyone,
I'm trying to implement the following logic in the Service Operations Workspace (SOW) form:
Whenever the field "On hold reason" (a choice field) changes — before the record is saved — I want to copy the label (not the value) of the selected choice into the "Short description" field.
I've already implemented this successfully using a Client Script on the standard form, but it doesn't work in the Configurable Workspace (SOW).
Is there a way to achieve this using Client View Rules, Data Broker, UI Component configurations, or any other recommended approach in SOW?
Any guidance or examples would be greatly appreciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 05:00 AM
that method won't work in workspace as it's not supported. see below
This is the workaround
Ensure Global Checkbox is checked in onChange client script so that it works in both native + sow
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
// add your choice values and choice labels in json object
var reasonLabels = {
'1': 'Awaiting Caller',
'2': 'Awaiting Evidence',
'3': 'Awaiting Problem Resolution',
'4': 'Awaiting Vendor'
};
var value = g_form.getValue('hold_reason');
var label = reasonLabels[value] || value;
g_form.setValue('short_description', label);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 04:31 AM - edited 06-26-2025 04:34 AM
Hello, the UI Type is already on "ALL" and still the script isnt working on the SOW.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 04:33 AM - edited 06-26-2025 04:35 AM
Thank you everyone for your help!
The UI TYPE is already on "ALL" and still its not working in the SOW - Service Operation Workspace.
There is another thing i can do ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 04:39 AM
I will add my Client Script to here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 05:00 AM
that method won't work in workspace as it's not supported. see below
This is the workaround
Ensure Global Checkbox is checked in onChange client script so that it works in both native + sow
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
// add your choice values and choice labels in json object
var reasonLabels = {
'1': 'Awaiting Caller',
'2': 'Awaiting Evidence',
'3': 'Awaiting Problem Resolution',
'4': 'Awaiting Vendor'
};
var value = g_form.getValue('hold_reason');
var label = reasonLabels[value] || value;
g_form.setValue('short_description', label);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 05:04 AM
Worked! Thank you!