Help Needed: UI Action Button in List View Not Triggering in ServiceNow Workspace

Shivam Singh1
Tera Contributor

Hi everyone,

I am trying to create a new action in the list view. I have created a new UI action button and written the following script in the UI action:

function onClick() {
   action.setRedirectURL('https://www.youtube.com/');
}

I added this code in the workspace client script and, for safety, included the same code in the normal script. To display this button in the workspace, I created an action assignment and set the implementation as a client script. The button is visible in the workspace, but no action is triggered when I click it.

Action assignment attachment:

ShivamSingh1_0-1741331356596.png

 

 

Ui action attachments:

 

ShivamSingh1_1-1741331139533.png

ShivamSingh1_2-1741331193446.png

 

 

Note: This code is working in the backend view in form and list level

 

Could anyone help me understand why this is happening and how to fix it?

 

Thank you!

3 REPLIES 3

Murthy Ch
Giga Sage

@Shivam Singh1 

Try this in workspace script:

function onClick(g_form) {
    top.window.open("https://www.google.com");
}
Thanks,
Murthy

I tried this, but it's not working as expected

Ankur Bawiskar
Tera Patron
Tera Patron

@Shivam Singh1 

action which is server side object won't work in workspace client script

use this code

function onClick(g_form) {
    open("https://www.google.com");
}

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