LinkedIn
Copied!

Passing custom data to the chatbot

When a customer launches the chatbot several properties are passed on to it by default. You may have to pass additional data dynamically to alter the bot behavior or to capture some data to send to the agent during a chat escalation.

Follow these steps to do so:

  1. In the downloaded self-service configuration folder of your web chatbot channel, open the PegaHelperExtension.JS file. 
  2. Update the preparePegaAParams function by adding the new key-value pairs, for example, pegaAParamObj.myparam= “Wednesday”;
  3. Create a new property in the Work-Channel-Chat class to hold that value, for example, MyChatServer. For more information, see Creating a property.
  4. In the Work-Channel-Chat class of your self-service application, update the pyDefault data transform to set .myServer to param.myParam.
  5. Use the SetContactContextWebChatBot data transform to copy the value set in the data transform, for example, .myServer, to the pyInteractionCase page.
    pyInteractionCase page is the context of the Bot interaction.

When the customer escalates the bot interaction to a CSR, the RetrieveBotTranscript activity is used to copy items from the pyInteractionCase page of the chatbot to the CSR side. 


33% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.