- 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-25-2025 08:26 AM
What is the 'UI type' value on the client script? One choice is "All' another choice is 'Mobile / Service Portal'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 12:05 PM
HI @ItayB ,
Make sure the UI Type is "All" in your client script.
Mark this as helpful and correct, if this solves your issue.
Thanks,
Yaswanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 12:46 PM
It amazes me why members post the same solution as was previously posted. Client Scripts do work in the Service Portal, it the type is not "Desktop".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 01:40 PM
Hi @WillieW ,
If you check the response, it was a question asked and suggested 2 of 3 options available, But my answer is having type as All- as this will work in both Classic and Portal views.
Client Scripts do work in the Service Portal, it the type is not "Desktop"- yes, they do will they work in Classic view as well, if you not explicitly selected All?