ServicePortal redirect URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 06:23 AM
Hello,
I am trying to change the ootb simple list widget to redirect the user a webpage outside servicenow.
At the moment when I click the link I want to trigger the redirect instead of going to https://www.newurl.com the user is being sent to http://instance.service-now.com/www.newurl.com.
So far I have tried
gs.setRedirect(url);
location.href(url);
$location.href(url);
$location.path(url);
How do I do this?
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 06:45 AM
Hi,
Just to clarify, you're using a simple list widget to redirect to an outside URL?
Any particular reason why you need to use a simple list widget when not directing them to an actual list...contained on your instance?
Could you use a different widget, say an Icon Link or something instead?
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 06:46 AM
try on the client side script
window.location.href = 'your_url';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 06:48 AM
Hello,
Could you please send the exact code and where did you put it? (server/client/link part of the widget?)
Also, do you have any console error?
Normally, you should achieve this with $location.url(url); (do not forget to check if $location is part of the parameters of your script).
Regards,
Anaïs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 07:16 AM
Hello,
No errors no,
(do not forget to check if $location is part of the parameters of your script).<- how would I check this
function ($scope, $location, $rootScope, spUtil, $interpolate) {
var c = this;
this.data.filterText = "";
this.showFilter = false;
this.onClick = function($event, item, url, action) {
$location.href(url)
}
this.getMaxShownLabel = function(maxEntries, totalCount) {
if (totalCount == c.data.maxCount)
return "${First [0] of more than [1]}".replace('[0]', maxEntries).replace('[1]', totalCount);
return "${First [0] of [1]}".replace('[0]', maxEntries).replace('[1]', totalCount);
};
c.getActionColor = function(action) {
return "text-" + action.color;
};
c.update = function update() {
c.server.update();
}
c.toggleFilter = function() {
c.showFilter = !c.showFilter;
}
}
