UI Action not working in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 09:05 PM
Hi I have added a button to the form, it's working in form which redirects to other login page but the same button is not working in workspace. How to fix this?
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 10:19 PM
@Deep_D In order to make the workspace button work you need to put your code in Workspace Client Script as well. Please note that current is not available in client script so you need to fetch a field value via g_form.getValue('field_name') method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 02:37 AM
Hi @Sandeep Rajput ,
I tried using below script but still it is not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 03:04 AM
@Deep_D Can you put an alert inside the Workspace client script and alert the value of redirectURL. Via this exercise, you will get to know if the redirectURL variable holds the URL value or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 02:47 AM
do this in workspace client script
I assume message_key field is of type URL and contains URL
function onClick(g_form) {
var redirectURL = g_form.getValue('message_key');
var win = top.window.open(redirectURL, '_blank');
win.focus();
}
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