Redirect to external URL after catalog item submission.

spike
Mega Sage

Following the submission of a catalog item, I want to redirect the user to an external URL, using some of the parms from the form in the URL. To that end I've written an on insert business rule as follows:

    var mainURL = 'https://airtable.com/XXXXXXXX?prefill_Email=';

    var urlFinal = mainURL + current.variables.email.toString() + '&prefill_name=' + current.variables.name.toString();

    gs.setRedirect(urlFinal);

However it just doesn't seem to work. I've debugged it and urlFinal is being constructed correctly. If I take the variable and paste the URL into a browser it works fine.

However off the back of the business rule all I get is a broken link image in the application window with the message "Airtable refused to connect."

I get the same message about refusing to connect regardless of the URL I put in (get the same with www.google.com):


Therefore I'm thinking it's not the external site per se but something that ServiceNow is doing. I'm expecting it to open the new site in that window, not in the main body (not that it's working anyway!)

Extensive browsing and doc reading had drawn a blank. Any help would be appreciated and advice would be appreciated.

 

4 REPLIES 4

Mohith Devatte
Tera Sage
Tera Sage

Hello,

Can you please use producer.redirect('your URL');

Please mark my answer corrcet if it helped you

Yousaf
Giga Sage

Hi Spkie,

Check this

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

 

Mark Correct or Helpful if it helps.

Thanks,
Yousaf


***Mark Correct or Helpful if it helps.***

That is a useful thing to know but doesn't give me what I need. I still need to have a request raised within ServiceNow for audit and tracking. Opening an external content item means that no request is created (as far as I can see). I did try hanging a Flow or business rule off of that but since nothing is getting created from the content block, there's nothing to trigger it.

Thanks all the same.