logo

NJP

ServiceNow Agent Workspace - Redirect to a URL from a form or a list

Import · Aug 30, 2022 · article

In this video, you will learn how to create UI action and List action for agent workspace to redirect users to a specific link.

The code used on the actions is below -

function onClick()
{
var win = top.window.open("https://yourinstance.service-now.com/sp", '_blank');
win.focus();
}

Edited
A few people have asked how to redirect to URLs on the workspace views itself, so here is how it can be done (this is a snapshot from one of the OOB code snippets) From workspace UI actions,

function onClick(g_form) {
    var blockId = g_form.getUniqueValue();
    var appConfig = g_form.getValue("document_id");
    var url = "now/ace-app-builder/editor/params/blockid/" + blockId + "/aceconfig/" + appConfig;
    open(url);
}​

image If this has helped you resolve your query, please like the post. Also if there are any questions or queries, please feel free to write them down below and I would love to answer them.

View original source

https://www.servicenow.com/community/now-platform-blog/servicenow-agent-workspace-redirect-to-a-url-from-a-form-or-a/ba-p/2332898