
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 12:02 PM
We are upgrading to San-Diego, which comes with a new Survey Widget.
I had modified the old widget where it would redirect the user to the Portal Homepage after the survey was finished.
Before I go to modify the new widget, I'm trying to find out if there is any better way to accomplish this.
What we want is it to redirect at this point. Right now in the new widget does not (although the link still works).
I've tried putting
<meta http-equiv="refresh" content="0; URL=/sp" />
Into the HTML field that houses the text in the survey. It wouldn't even save it that way. I also tried:
<script type="text/javascript">
window.location.href = "/sp"
</script>
Same thing, the HTML field would not have any of that.
I'm really hoping there is some way to accomplish this without having to modify the widget. While I'm willing to do it, it seems like such a small thing to do that over.
I also can't find any instance options or anything in the code of the widget where it looks like I could feed this in.
Any ideas?
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 10:14 PM
Hi Mark,
If you can inspect the submit button, you can build a widget (only have the listener of the button). In the client controller, add the click event and set some timeout for that, so it will redirect after the button is submitted.
Mark ✅ Correct if this solves your issue and also mark ???? Helpful if you find my response worthy based on the impact.
Cuong Phan
Senior Consultant.
Cuong Phan
ServiceNow Technical Lead

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 10:14 PM
Hi Mark,
If you can inspect the submit button, you can build a widget (only have the listener of the button). In the client controller, add the click event and set some timeout for that, so it will redirect after the button is submitted.
Mark ✅ Correct if this solves your issue and also mark ???? Helpful if you find my response worthy based on the impact.
Cuong Phan
Senior Consultant.
Cuong Phan
ServiceNow Technical Lead

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022 05:29 AM
Hi Cuong,
I like this idea. How can I access a button within another widget in my widget?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022 07:19 AM
Ok.. Here is what I came up with....
angular.element($window).on('click', function(event){
if(event.target.innerText == 'Submitting...' && event.target.localName == 'button'){
$window.location.href = "/sp";
}
});