- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 02:27 PM
Hello - I am trying to get our 'Flow Context' UI Action on the RITM table to work within Service Operations Workspace. The UI Actions opens the flow designer flow that is executing from the RITM. The option shows up in the Form Menu, however, once I click on it, nothing happens. I don't receive an error or anything, nothing happens after clicking.
I copied the code from the 'Script' field into the Workspace Client Script field, but that doesn't seem to work from what I am experiencing.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 08:47 PM
this code worked for me
function onClick(g_form) {
var gr = new GlideRecord("sys_flow_context");
gr.addQuery("source_record", g_form.getUniqueValue());
gr.query(checkRecord);
function checkRecord(gr) {
if (gr.next()) {
var url = '/now/workflow-studio/builder?tableName=sys_flow_context&builderId=flow-execution&sysId=' + gr.sys_id;
open(url);
}
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 10:52 AM
Thank you very much for the code, it is working perfectly now, thanks!!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 07:46 PM
Hi @jlaue ,
When adapting a UI Action for use in the Service Operations Workspace (SOW), there are a few things to keep in mind. The client script in the workspace operates differently compared to traditional UI Actions. Workspace uses the declarative action framework, and you need to adjust your approach accordingly.
In Workspace, the g_form object does not behave exactly as it does in the classic UI.
You need to use action APIs provided by Workspace.
try with this code
function executeAction() {
// Get the sys_id of the record
var sysId = action.getGlideRecord().getValue('sys_id');
// Construct the URL to the Flow Context
var url = new GlideURL('catalog_flow_context.do');
url.addParam('sysparm_sys_id', sysId);
url.addParam('sysparm_ck', g_ck); // Use 'g_ck' if it's available in your session
// Open the Flow Context in a new tab
window.open(url.getURL(), '_blank');
}