logo

NJP

Request a Catalog Item via UI Action / Workspace

New article articles in ServiceNow Community · Aug 31, 2026 · article

This simple solution will spawn a Catalog Item / Record Producer / Order Guide from a button/link.  In this specific example, I'm using the Project Workspace, but a similar script could be used on a form in the native UI.  I came across some outdated articles on how to open a Catalog Item with a declarative action and other UI Action methods, but could not get any of those ideas to work in more recent releases.

 

Since UI Actions still work in workspaces, here's the setup:

BradBowman_0-1788180680213.png

Notice the Script field is empty.  Since this is intended for a workspace, the script is placed down below, in the Workspace section:

BradBowman_1-1788180843921.png

The top part makes it appear in the workspace (on the Project record in this case since that's the Table the UI action is attached to), while the script makes it work when clicked.  You just have to replace the sys_id with that of your Catalog Item or Order Guide.  

function onClick(g_form) { //var url = 'com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=378b2325c397bad0676a07f9d0013172&sysparm_v_project=' + g_form.getUniqueValue(); //Catalog Item var url = 'now/nav/ui/classic/params/target/com.glideapp.servicecatalog_cat_item_guide_view.do%3Fv%3D1%26sysparm_initial%3Dtrue%26sysparm_guide%3D988fc596c35f3e14676a07f9d001312d&sysparm_v_project=' + g_form.getUniqueValue(); //Order Guide open(url); }

This is using the same URL as is displayed when opening a new request via the service catalog.  The last parameter is optional.  I want to submit this Catalog Item for the project that I was on when clicking the link, so I'm using it to pass the Project record sys_id to a variable in the Catalog Item/OG, which I am populating via an OnLoad Catalog Client Script:

function onLoad() { //Populate the variables with the parameters passed in the URL //Use the 'getParmVal' function below to get the parameter values from the URL //Build RACI UI Action passes in project in sysparm_v_project var project = getParmVal('sysparm_v_project'); function getParmVal(name){ var url = document.URL.parseQuery(); if(url[name]){ return decodeURI(url[name]); } else{ return; } } g_form.setValue('v_project', project); }

Note that this script uses DOM manipulation, so ensure the Isolate script box is unchecked.

 

Here's what it looks like in the Project Workspace with the options I've selected - within the three dots More Actions menu:

BradBowman_2-1788181125067.png

Clicking the link in this case opens the Order Guide in a separate tab, which I found to be less confusing for these particular users than taking them out of the Project Workspace and leaving them there after the Order Guide was submitted.  On-screen and documented procedures for this process instruct them to close the browser tab to return to what they were last working on in the Project Workspace. 

 

 

View original source

https://www.servicenow.com/community/itsm-articles/request-a-catalog-item-via-ui-action-workspace/ta-p/3593055