Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

In the AWA queue, is it possible to put a variable in the initial agent response?

Dalto Roberto
Tera Contributor

Hi,

In the AWA queue, is it possible to put a variable in the initial agent response?
I would like to put the Agent's name and the Customer's name, like this:
"Hi {CustomerName}! My name is {AgentName}, how can I help you?"

If not, is there any other way to include this custom phrase in the chat service after distributing the AWA in the queue?

5 REPLIES 5

Hi @Dalto Roberto ,

 

Can you please try with replacing below code in 'Greeting response' script in "Start Segment Properties" of Live Agent Support topic(as mentioned above screenshot);

 

 

(function execute() {
    var originalUser = gs.getSession().impersonate("system");
    var agentName = sn_connect.Conversation.getAgentName(originalUser);

    var msg1=gs.getMessageLang("Hi {0}!",[vaInputs.user.first_name]); //{CustomerName}
    var msg2=gs.getMessageLang("My name is {0}, how can I help you?",[agentName]); //{AgentName}

    return msg1+' '+msg2; //"Hi {CustomerName}! My name is {AgentName}, how can I help you?"
})()

 

 

I hope this solves your issue.
Mark this as Helpful / Accept the Solution if this clears your issue.

 

Thanks,

Ratnakar