Passing parent URL parameters from Configurable workspace to service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 12:05 AM
Hello,
I have a requirement to replicate a native UI functionality into configurable workspace.
Once you click on the save button on the case record, it should redirect to open the service portal in a new tab and parent parameters(table name and sys_id of the parent record should be passed to the url).
I am able to achieve the redirection using a workspace client script on the 'Save' UI action.
var result = g_form.submit('sysverb_ws_save');
if (!result) {
//failed form submission
return;
}
result.then(function() {
var params = {};
params.parent_table = "my_table_name";
params.parent_sys_id = g_form.getUniqueValue();
g_service_catalog.openCatalogItem('sc_cat_item','-1', params);
});
}
As you can see, I am passing the parameters here. But, when I try to retrieve these parameters in one of the widgets using $sp.getParameter("parent_sys_id") on the server side, I get null value.
I tried to print the url using window.location.url and I get "https://instancename.service-now.com/swp"
which means the parameters are not getting passed to the url from UI action.
Can anyone please help, where I am making a mistake? or any other way to achieve this in configurable workspace?
P.S. Same script works for the Agent workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 03:53 PM
Hi @Wybren1 ,
Thank you so much for the useful Catalog Client Script! I managed to get the parameter from URL in CSM Workspace successfully and the value auto population is working as expected. Again, thank you!!