Catalog Item in Workspace Prefills Old Record Data When Opened from Different Records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
We are opening a Record Producer from an agent record in the Configurable Workspace using a client-side UI Action.
The parent record sys_id of the agent is being passed and used in the on load client script in the record producer to prefill a variable (user) in it.
The issue is that when the record producer tab remains open, and we navigate to another agent and trigger the same action again, the previously populated sys_id is retained rather than being refreshed with the new record’s sys_id and the same tab is being opened.
We are currently using client-side parameter passing and local storage to transfer the sys_id.
Has anyone implemented a reliable way to pass parent record context to a catalog item in Configurable Workspace without stale data issues?
Or the problem is in how we are opening the Record producer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
yes this happened with me as well.
didn't find any concrete solution for this.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Thanks for taking some time on this @Ankur Bawiskar 😌
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
54m ago
In Configurable Workspace, the issue is usually not the Record Producer itself but how parameters are passed and read.
If you’re using localStorage to transfer the parent sys_id, that can cause stale data when the tab is reused. Workspace reuses the same component instance, so stored values may persist.
Instead, you can pass the value directly using g_aw.openRecord() and read it from the Workspace route. Official Documentation: GlideAgentWorkspace (g_aw) | ServiceNow Developers
UI Action:
g_aw.openRecord('sc_cat_item', 'record_producer_sys_id', {
parent_sys_id: g_form.getUniqueValue()
});In Configurable Workspace, parameters are not passed as normal query strings (?param=value). They are embedded in the route under /extra-params/
So in the Record Producer onLoad Client Script, you can extract it from the URL like this:
function onLoad() {
var url = decodeURIComponent(top.location.href);
if (url.indexOf('cwf/agent') > -1) {
var workspaceParams = url.split('extra-params/')[1];
var allParams = workspaceParams.split('/');
var sysId = allParams[1];
if (sysId) {
g_form.setValue('manager', sysId);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
45m ago
did you test it with different records?
share working screenshots
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
