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

-O-
Kilo Patron
Kilo Patron

While that is possible, it doesn't seem to be a very good experience. Wouldn't it be simpler to add a help text containing the link and explaining when and how to use it?

leport
Tera Contributor

Thank you - I agree this may not be the best user experience if user mistakenly selects something, but I would like to know if it is possible and if so, how

Aman Kumar S
Kilo Patron

Just on selecting, I think we should not redirect, because someone can select it by mistake as well, rather we can have some kind of confirm box, before the redirection happens:

Below code snippet should help:

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(g_form.getValue('request_type') == 'password_reset'){
g_form.addInfoMessage("<Your URL>' target = '_blank'>Please raise a laptop issue via this link </a>");
}
}

 

function onSubmit() {
if(g_form.getValue('request_type') == 'password_reset'){
alert('Please navigate to xyz page to achieve this');
return false;
}
}

 

There are few relevant articles around this that you can try, but it will be lil tricky to achieve:

https://community.servicenow.com/community?id=community_question&sys_id=e67b3df71b239810d2ccea89bd4bcb58

Best Regards
Aman Kumar

Thank you - I have this on the catalog item already but the ask from the Business Stakeholder is to automatically redirect the user upon selection of a combination of values within the variables.  I agree this may not be the best user experience if user mistakenly selects something, but I would like to know if it is possible and if so, how