- 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-06-2025 07:33 PM
but why?
how it will help the agents to know about the flow context?
let them visit native and click the UI action. it will work from there
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-06-2025 07:44 PM
if you still require then update as this in workspace client script
Ensure you set both the checkboxes as true
Workspace Form button and Format for Configurable Workspace
I haven't tested this
function onClick(g_form) {
var url = 'catalog_flow_context.do?sysparm_sys_id=' + g_form.getUniqueValue() + '&sysparm_ck=' + g_form.getValue("sysparm_ck");
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-06-2025 08:04 PM
if the above script doesn't work then you can query flow context table with the current ritm sysId and get the flow context sysId and open the 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-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