- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2025 04:54 AM
Hello everyone,
In Service Catalog, I want a new website to open after clicking a checkbox variable. How can I achieve this?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2025 05:01 AM
you can use onChange catalog client script and open the URL in new tab
this will work in both native and portal
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
try {
if (window == null) // portal
{
var url = ''; // your website
top.window.open(url, "_blank");
}
} catch (ex) {
var url = ''; // your website
g_navigation.open(url, '_blank');
}
}
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
‎03-12-2025 04:57 AM
Hello @Kishore47
You need to develop an onChange Catalog Client script as shown below:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// Replace with your website URL here
var websiteURL = "https://www.google.com";
if (newValue == 'true') {
window.open(websiteURL, '_blank');
}
}
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2025 05:01 AM
you can use onChange catalog client script and open the URL in new tab
this will work in both native and portal
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
try {
if (window == null) // portal
{
var url = ''; // your website
top.window.open(url, "_blank");
}
} catch (ex) {
var url = ''; // your website
g_navigation.open(url, '_blank');
}
}
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