Add a custom page that makes sense that redirects to the long Catalog url

Brian Whyte
Kilo Guru

I'd like to create a custom page that simply links to another page that has a really long ugly URL. For example, I'd like to be able to send my user to this...

 

https://myservicenowinstance.com/order-computer

 

and upon hitting this page, it redirects them to this...

 

https://myservicenowinstance.com/sp?id=sc_cat_item&sys_id=437f6eb581a43010442d73239b6e3566&referrer=...

 

How can this be accomplished?  Once I know how to define this page, I'll just update the source of it to...

 

<script>

window.location.replace("https://myservicenowinstance.com/sp?id=sc_cat_item&sys_id=437f6eb581a43010442d73239b6e3566&referrer=popular_items");
</script>

 

Within the UI, I don't know how to create a page like this.  I've looked at Service Portal Pages, Now Experience Pages, and UI Pages.  I could do a Scripted REST API page, but that doesn't seem like the right vehicle either.

1 ACCEPTED SOLUTION

Brian Whyte
Kilo Guru

I found one way using UI Pages.  Created page called order-computer. Then defined JS to be:

addLoadEvent(redirectme);

function redirectme()
{
	
	top.window.location.replace("https://myservicenowinstance.com/sp?id=sc_cat_item&sys_id=437f6eb581a43010442d73239b6e3566&referrer=popular_items");
}

I can then go to https://myservicenowinstance.com/order-computer.do

 

Seems to work. Is there another way I should be doing this?

View solution in original post

1 REPLY 1

Brian Whyte
Kilo Guru

I found one way using UI Pages.  Created page called order-computer. Then defined JS to be:

addLoadEvent(redirectme);

function redirectme()
{
	
	top.window.location.replace("https://myservicenowinstance.com/sp?id=sc_cat_item&sys_id=437f6eb581a43010442d73239b6e3566&referrer=popular_items");
}

I can then go to https://myservicenowinstance.com/order-computer.do

 

Seems to work. Is there another way I should be doing this?