Offer user more options when live agent is unavailable

Yasmin
Kilo Guru

Upon transferring a user to a live agent the script detects if there are any live agents available. IF there are no live agents available, VA says "Please try again later". Instead, we would like to offer additional options to the user such as: 

1. Try a new search
OR
2. Submit a case/incident. 

Is there a way to configure this within the set up topic so that everytime the live agent is unavailable, user can select other options? Thank you.

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi Yasmin,

As suggested by Vishwa, you can follow the first step and you can remove the else section (I am telling you to remove else section because if the chat is transferred to live agent, else block will not run anyways). Next, in the workflow you can show a static choice of these 2 options(This will run only when the live agent is not available). So, once the user selects:

1) Create a Ticket workflow

2) Show all the topics again

To show all the topics again you have will have to create a Reference Choice and a Script. The reference choice will pick up topics from '' table and code will look like this in reference choice (untested code)

var options=[];
var gr = new GlideRecord('sys_cs_topic');
gr.addEncodedQuery('active!=false^nameNOT LIKE_PRVW')
gr.query();
while(gr.next()){
options.push(gr.name)
}
return options
 

and in Script you can have the following code.

(function execute() {
vaVars.global_search_text = vaInputs.topic_list;
vaSystem.topicDiscovery();
})()

find_real_file.png

 

Let me know if you have any questions. 

Please mark this article as Helpfil if it helped you.

Cheers,

Hardit Singh

View solution in original post

7 REPLIES 7

Vishwa Prakash
Kilo Expert

Hi Yasmin, 

I understand that you would like the VA to offer additional option in case the live
agent is unavailable. vaSystem.isLiveAgentAvailable() method is used to verify if Live Agent is available.

I suggest you to try the if else condition to fulfill the requirement. 

    if(vaSystem.isLiveAgentAvailable())
    {

     vaSystem.connectToAgent()

    }

    else

Hope this helps. Please mark it correct and useful.

Thanks

Thanks. I have duplicated the OOTB Live Agent Support topic in order to make this modification on the script as advised. This is the script:

(function execute() {

if (vaSystem.isLiveAgentAvailable())
{
vaSystem.connectToAgent();
}
else
{
return'Offer more options sample text';
}
 
})()

Unfortunately, when I preview it keeps saying that the "Glide Variable name 'user' appears more than once in the topic. It must be unique." 

Not sure if this is a defect, or something I need to fix in the backend, but I for sure don't want to have to modify the OOTB Live Agent Support topic.

Any ideas how to overcome that? Thank you.

 

Hi Vishwa. I've tried this option but I'm not clear on what to input after Else because what I'd like to do is, if chat agents are not available, then allow the user to choose between the below 2 options. There are User input controls that I'm hoping to be able to use in order to prompt the user to select from available options: 

Trying a new search

OR

Opening a case

So, once the VA attempts to connect to a Live Agent and detects that no agents are available, Is there a way to continue the confersation flow using the controls already available rather than hard coding these 2 options?

Thank you.

Community Alums
Not applicable

Hi Yasmin,

As suggested by Vishwa, you can follow the first step and you can remove the else section (I am telling you to remove else section because if the chat is transferred to live agent, else block will not run anyways). Next, in the workflow you can show a static choice of these 2 options(This will run only when the live agent is not available). So, once the user selects:

1) Create a Ticket workflow

2) Show all the topics again

To show all the topics again you have will have to create a Reference Choice and a Script. The reference choice will pick up topics from '' table and code will look like this in reference choice (untested code)

var options=[];
var gr = new GlideRecord('sys_cs_topic');
gr.addEncodedQuery('active!=false^nameNOT LIKE_PRVW')
gr.query();
while(gr.next()){
options.push(gr.name)
}
return options
 

and in Script you can have the following code.

(function execute() {
vaVars.global_search_text = vaInputs.topic_list;
vaSystem.topicDiscovery();
})()

find_real_file.png

 

Let me know if you have any questions. 

Please mark this article as Helpfil if it helped you.

Cheers,

Hardit Singh