UI Action setRedirect not working on external link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 01:26 PM
While trying to do a action.setRedirectURL to an external link, when I run the UI action, nothing happens. ServiceNow goes to a blank screen.
Code is as follows but I am at a loss as to understand why this is happening:
var url = 'http://www.yahoo.com';
action.setRedirectURL (url);
The Yahoo Link is just there for show and it won't go to the URL itself. This has been set up to be a non-client UI action so I'm not sure what I'm missing.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2018 05:33 PM
I think the cabrillo API is specific only to the Mobile App (the one you download on the store).
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2018 07:32 AM
That's fine and all, but how do I code with it? There is nothing in the documentation on how I can instantiate it on my instance, and any attempts to put in cabrillo code results in a compiler error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2018 07:32 PM
Hi,
Can you plz go and check if the gs.setRedirect() id bring used in any of the BR on your table
If so,kindly comment it out and then,check if it works.
Regards,
Munender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2018 07:55 PM
HI,
Can you try this below function which has example of google.
function redirecta()
{
window.open("https://www.google.com", "_blank");
}
Call redirecta(); function onClick.
Let me know if you were able to achive it.
Regards,
Vignesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2018 07:59 PM
window.open should be avoided:
ServiceNow Best Practice - Avoid DOM Manipulation.
g_navigation, action.setRedirectURL and gs.setRedirect exist in it's place.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022