UI action is not working at client side in Service Operations workspace

Ashish Gupta8
Tera Contributor

While my UI action is working in Classic UI, it does not work in SOW until the client box is checked. We have a UI action "Create Request" which should redirect the interaction (IMS) record to Service Portal page and close complete the IMS record. Script as follows:

 

For Classic UI (without Client is checked) - 

var url;

action.setRedirectURL(url);
current.state = 'closed_complete';
current.update();

 

 For SOW (CLient needs to be checked and Workspace Form button) - 

function onClick(g_form) {
}
 
Question: How can we make UI action in a way that it sync in both the UIs? It should work in Classic UI and SOW as well. Pls suggest a way to code. Thanks!
2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Ashish Gupta8 

don't include actual client instance name in your question.

2 ways to achieve.

Approach 1

1) your UI action should be server side with only Script field.

2) Don't add anything in Workspace client script, the redirection will happen within workspace only

Approach 2

1) make UI action client side and use this code in script and workspace client script

Client - true

Onclick - showCatalogItem()

Script:

function showCatalogItem() {

    var url = "https://instanceName.service-now.com/sp?id=sc_category&sys_id=23b93ae70ba25110235c477f40f8df75&catalog...";
    g_navigation.open(url, '_blank');
    g_form.setValue('state', 'closed_complete');
    g_form.save();
}

AnkurBawiskar_0-1751288854290.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Badrinarayan
Tera Guru

Hi @Ashish Gupta8 

If you want a UI Action (like a button or link) to work the same way in both the classic (native) UI and the Service Operations Workspace (SOW), you need to enable it for both interfaces.

In the UI Action settings, first check the "Client" checkbox—this allows it to run on the client side. Then scroll down and also check the "Workspace" checkbox. This enables the button for use in Service Operations Workspace.

Without this, your UI Action might only work in classic UI but not in SOW.

 

Screenshot 2025-06-30 at 6.34.26 PM.png

 

  • Open the UI Action.

  • Check the "Client" checkbox – this allows the action to run on the client side.

  • Scroll down to the Workspace section.

  • Check "Workspace form button" to show it as a button in SOW.

  • Check "Format for configurable workspace" for workspace compatibility.

  • Optionally, check "Workspace form menu" if you want it to appear in the menu too.

 

 

Badrinarayan_0-1751288846311.png

Thanks & regards,
Badrinarayan