Redirect users to a URL based on Variable Selection

leport
Tera Contributor

I have a catalog item used for a variety of user account requests - new account creations, server access etc. 

There is one process for password resets that exists outside this form.  Is there a way to redirect user to a specific URL if they select a specific combination of variables.

 

For example, if they select Request Type = Password Reset can I automatically route them to a URL when they select that Request Type, but selection of other request types would leave them in this Catalog Item?

1 ACCEPTED SOLUTION

@leport 

I tried this, works like a charm!

find_real_file.png

Best Regards
Aman Kumar

View solution in original post

12 REPLIES 12

@leport 

I tried this, works like a charm!

find_real_file.png

Best Regards
Aman Kumar

Thank you so much! That works exactly as I need

Thanks for this! I'm attempting to use this and I am clearly missing something. My scenario:

 

I have a select box for "request type". If users select "PDQ", then they should be re-routed to an alternate catalog item. 

 

I've found that the redirect is happening, regardless of which type is being selected.

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
          return;

    }
    var type = g_form.getValue('monitoring_type');  
	if (type == 'PDQ');
      top.window.onbeforeunload = null;//this removes the popup that asks if you want to leave
      top.location.href = '/sp?id=sc_cat_item&sys_id=2ab05f721b129110b7b35284604bcb81';
}

 Pointers on how I should fix this?

 

@Yolanda6 

I have adjusted your script, please follow the below script:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
          return;

    }
    var type = g_form.getValue('monitoring_type');  
	if (type == 'PDQ'){
      top.window.onbeforeunload = null;//this removes the popup that asks if you want to leave
      top.location.href= '/sp?id=sc_cat_item&sys_id=2ab05f721b129110b7b35284604bcb81';
   }
}

Best Regards
Aman Kumar

Thank you! This resolved my issue perfectly.