Service Portal Service Catalog Item widget redirect to custom page based on item

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2018 01:02 PM
I am using the SC Item widget [widget-sc-cat-item-v2] in the Service Portal on the Kingston release.
After the user submits the form, I want to redirect the user to a custom page instead of the default redirect location.
Also, I want to set the redirect based on the item. In other words, most items will redirect to the default location, whereas other items must redirect to the custom confirmation page.
Is there a way to do this by passing in the desired redirect location without modifying the out-of-box widget?
Or if the widget does need to be modified, what is the best way to do this with minimal code revisions?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2018 02:09 PM
I did something similar while back but it was for only 1 item so I added onSubmit Catalog Client script. You can add this to all item that you want to redirect to specific url.
function onSubmit() {
top.window.setTimeout(fun2,2000);
function fun2() {
top.window.location = "sp?id=xxxxx";
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2018 09:51 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2019 03:55 PM
Aaaaand the answer was??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2022 09:00 AM
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0656003
INFO FROM ABOVE SOURCE
- Widget Instance level (SC Catalog Item widget) Catalog item redirection
To redirect all users to a specific page after each catalog item submission:- Go to /sp?id=sc_cat_item.
- Press Ctrl + Right Click and select Instance Option.
- For the option Successful Order Page, choose the desired page.
- Note: In the same widget instance, there is an option to add a default page. Choose the desired table in the Successful Order Table field.
- Once you have successfully configured these, you should be able to click on the link generated in the success message to navigate to the desired page/record.
- If you want users to auto-redirect to the configured pages on submission, check the Auto Redirect on Successful Order option.
- Record producer script redirection
- If you are looking for specific page redirection based on a script for Record Producer, use this example script:
producer.portal_redirect = "?id=sc_home"
- If you are looking for specific page redirection based on a script for Record Producer, use this example script: