Show message and then redirect to another page after few seconds in Record Producer

haffiez5181
Tera Contributor

Greetings SNOW Expert,

 

I am not sure if someone already posted similar issue/question however I am not able to find related information for my current issue. This is actually my 3rd post on the same question as the previous two was "rejected", not sure where I did wrong.

 

I have a catalog form from record producer which whenever submit, it will create an Incident ticket.

It has been setup with some scripts to define certain field (user's, contact number, urgency and designated support group whenever a user choose from the drop down.

 

The form will show the Incident details after being submitted by the user. Currently I am getting issue to make the form do like below:

 

1. When user submit the form, instead of showing the Incident details, the page will just showing a message. Example: Thank you for visiting xxxxx Lounge. Your ticket is INC00877785. Thank you for your submission.

 

2. From above, after few seconds, let say 10 seconds, the page will be redirected to the same catalog form again ready for the next user to fill and submit.

 

*** the form is intended to be used at IT Lounge where users come and submit for ticket creation.

 

Sample of form URL :  https://instance.service-now.com/esc?id

 

For the script part, this is the sample.

===================================================================

//set channel

current.contact_type = "Walk-in";

 

//set impact and urgency

current.impact = "3 - Low";

current.urgency = "3 - Low";

 

//set var to lounge

var lounge = producer.lounge_location;

 

//INC assign to abc group

if (lounge == "Lounge_ABC"){

current.assignment_group = "0de89fe093f10250057c7fda6aba10ce"

}

//INC assign to def group

if (lounge == "Lounge_DEF"){

current.assignment_group = "4a7a9f2493f10250057c7fda6aba10ad"

}

 

//Message after click submit

var message = "Thank you for visiting Lounge. Your ticket is "+current.number;

message += ". Thank you for your submission.";

gs.addInfoMessage(message);

 

//Redirect after X seconds

gs.sleep(5000);

producer.portal_redirect = "https://instance.service-now.com/esc?id=sc_cat_item&table=sc_cat_item&sys_id=e9805fec93710250057c7fd...";

=========================================

 

Current script behavior:

1. with gs.sleep in place, it did not displaying the ticket number. Once hit on submit button, it will delay for 5 seconds then redirect to another page.

 

2. Turn Off delay & redirect : ticket number is displaying as intended but no redirect.

 

I am not well verse in scripting. The above scripts was came from various combination of script based on reading over internet.

 

Any help is much appreciated.

 

Thank you

1 REPLY 1

Zmud1
Tera Contributor

Hi, have you found solution to this? I have a similar request.