Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI builder redirect from current next experience page to a different next experience page

Deven Olson
Tera Contributor

I am trying to route users from our Unified Navigation(now/nav/ui/home) home page to our CSM/FSM configurable workspace(now/cwf/agent). From what I have found you can only redirect/route to a page that exists in the current experience or you can go to any url through external link to destination event handler. I want to redirect within the same view. External link to destination event handler will not work for our use case unless there is a way to use it within same view/current tab.

 

Example:

  1. current URL (now/nav/ui/home)
  2. call event handler on page load from body event mapping
  3. rewrite current URL within current view to (now/cwf/agent/record/[table_name]/[record_sys_id])
1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You should be able to do this by using a script with the Link to destination event handler. The thing you're probably missing is passing target: _self with the external property. I did a quick mockup with redirect to the service operations workspace when clicking on an incident from the unified nav homepage using this script:

 

/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
*/
function evaluateEvent({api, event}) {
	return {
		route: null,
		fields: null,
		params: null,
		redirect: null,
		passiveNavigation: null,
		title: null,
		multiInstField: null,
		targetRoute: null,
		external: {
            "url": "/now/sow/record/incident/" + event.payload.sys_id,
            "target": "_self"
          }
	};
}

 

BradTilton_0-1683323659409.png

Service Operations Workspace does something like this. When you have SOW installed it adds a variant to the unified nav homepage that redirects itil users from the unified nav to to the SOW home page.

View solution in original post

2 REPLIES 2

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You should be able to do this by using a script with the Link to destination event handler. The thing you're probably missing is passing target: _self with the external property. I did a quick mockup with redirect to the service operations workspace when clicking on an incident from the unified nav homepage using this script:

 

/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
*/
function evaluateEvent({api, event}) {
	return {
		route: null,
		fields: null,
		params: null,
		redirect: null,
		passiveNavigation: null,
		title: null,
		multiInstField: null,
		targetRoute: null,
		external: {
            "url": "/now/sow/record/incident/" + event.payload.sys_id,
            "target": "_self"
          }
	};
}

 

BradTilton_0-1683323659409.png

Service Operations Workspace does something like this. When you have SOW installed it adds a variant to the unified nav homepage that redirects itil users from the unified nav to to the SOW home page.

Thank you this worked!