Redirect URL from dropdown.

Brian Lancaster
Tera Sage

Hello All,

There was a page created outside of service now.   We want to make it so that if someone picks something specific from a drop down it redirects to our internal internet site.   Is there anyway to do this?

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

Found my own answer.   Looks like I just need a client script for on change and look for when the variables changes.



function onChange(control, oldValue, newValue, isLoading) {


  if (!isLoading) {


  var reqType = g_form.getValue('request');


  if (reqType == 'Redirect URL') {


  window.open("http://www.google.com");


  window.location = 'home.do';


  }


  }


}


View solution in original post

10 REPLIES 10

right before 

if (newValue == 'Create New Catalog Item') {

add

alert(newValue);

Community Alums
Not applicable

Hi @Brian Lancaster ,

I hope you are doing well. We used to be in touch with ATF. You helped me multiple times. Thank you. I got the exact requirements as you and it is not working or me. Kindly help.

 

I am creating a dropdown with URLs. But when I select the URL option, it is not opening the window associated. Alert is working correctly, but not the URL. It is our internal URL. Kindly help.

value.PNG

 

error.PNG

 

Regards

Suman P.

url.PNG

 

 

Add Isolate script to the list layout of your client scripts. Make sur this is set to false.

Community Alums
Not applicable

Thank you @Brian Lancaster 

Shriram Joshi
Tera Guru
Tera Guru

Hi @Brian Lancaster - I have achieved the requirement with your post thank you so much for that.

 

I want to achieve another thing is to skip below pop-up for better user experiences on the portal. I tried to clear the field as well, but it did not work, do you have any idea on this? 

ShriramJoshi_0-1756121236436.png

 


BR,
Shriram Joshi

---------------------------------------------------------------------------------------------

Mark this as Helpful / Accept the Solution if this helps.