action.setRedirectURL(); function not working in UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2025 06:47 AM
I am trying to redirect URL to a Service Portal page, but i can't able to do that.
current.approval_status = "approved";
current.update();
var url = "https://sarvatrdev.service-now.com/cgn";
action.setRedirectURL(url);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2025 07:01 AM
what type of UI action is this?
It should be server side.
Share complete script and UI action configuration screenshots.
Where are you running this? native or from portal form or from workspace
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
‎02-10-2025 04:16 AM
I created two server-side UI actions configured to redirect to a Service Portal page. They work as expected in the native view but not in the Service Portal view.
Approve UI Action
Reject UI Action
var url = "https://sarvatrdev.service-now.com/cgn";
action.setRedirectURL(url);
I need the action to be performed in service portal, but it is not redirecting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2025 05:22 AM
action.setRedirectURL doesn't work in portal side; there is a KB for this
action.setRedirectURL(url) does not work in UI Action for Service Portal
check this link for workaround
A work-around for setRedirectURL() in the Portal
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
‎02-10-2025 04:32 AM
@Ankur Bawiskar
I created two server-side UI actions configured to redirect to a Service Portal page. They work as expected in the native view but not in the Service Portal view.
var url = "https://abc.service-now.com/cgn";
action.setRedirectURL(url);