Contributed by Sravani Mojjada and Mireille Dallaire
Prerequisite information
Symptoms
Environments
Explanations
Solutions
Related content
Prerequisite information
Legacy Webchat (formerly known as Pega Chat) is deprecated in Pega Platform ™ 8.6 and not supported from Pega Platform 8.7 onward. Chat functionality is available using Web Messaging (website-embedded chat) as part of Digital Messaging, starting with Pega Platform 8.4. For help migrating from Legacy Webchat to Web Messaging and for more about Digital Messaging, see the Related content.
Symptoms
After chat users select the menu item during the Chat with the bot, that menu item remains visible to users, allowing them to click it multiple times and potentially start duplicate threads for the same question in the conversational channel.
In the following example because the menu item remains visible after the user selected it, Live Chat is initiated multiple times.
Environments
The problem might be seen in any environment and product version that supports Digital Messaging.
Because most of the functionality of Digital Messaging - Web Messaging (which replaces Legacy Webchat) is the same whether implemented in Pega Platform or Pega Customer Service, the scenarios explained pertain to all product releases from 8.4 onward.
Explanations
In Pega Platform 8.4 and later releases, the logic for channel Menu options has changed.
The intended and expected behavior is that Web Messaging - Menu bot responses specified as Replies no longer display all menu items after the user selects one. However, menu responses specified as Buttons persist throughout the conversation. The unexpected behavior of the multiple displays of Live Chat in the case reported is caused by the fact that Buttons is specified as the menu response type. The menu item behavior is the same regardless of how many menu responses you specify as either Buttons or Replies.
The problem can occur when you use either of the following approaches in the design of your response menus for the Web Messaging conversational channel.
Scenario 1 Response Configuration > Menu Template specifies Buttons
Scenario 2 Response Type is Custom menu with Data Transform
Scenario 1 Response Configuration > Menu Template specifies Buttons
Click Response Configuration window. Notice that Response type specifies Menu and that the Menu Template you have selected is Buttons. Your choice of Buttons is what causes the Button type menu responses to persist throughout the conversation. Because Button type menu items remain visible after they are selected, application users can inadvertently initiate the same menu response multiple times. Solution 1 explains that you need to specify Replies for the Menu Template. and view the
Scenario 2 Response type is Custom menu with Data Transform
Your application uses a Custom menu as the response type for the command and populates the items by manually specifying them in the pyInteractionCase.pyOutboundMessage.Choices page of the Data Transform that sources the custom menu. This approach works in Legacy Webchat, but it causes the reported problem in Digital Messaging.
For Digital Messaging-Web Messaging, applications that use the Custom menu with the pyInteractionCase.pyOutboundMessage.Choices page of the Data Transform will continue to display a menu item after the user has selected that menu item. Solution 2 explains how to resolve this problem.
Solutions
Consider how you want your Digital Messaging-Web Messaging menus to work in your application given the following design choices:
- Design your menu items to keep displaying so that the user can return to them later, for example, Help or FAQs reference items.
- Design menu items to be selectable only once for a given menu item.
The solutions provided in this section correspond to the two scenarios described in the Explanations.
Solution 1 Response type Menu with Menu Template = Replies
Solution 2 Response type Custom with Data Transform set to Replies
Solution 1 Response type Menu with Menu Template = Replies
In Response type = Menu, in the Menu Template field, change Buttons to Replies as shown in the following figure. window, for
Solution 2 Response type Custom with Data Transform set to Replies
If the Response type is Custom, then for the Data Transform specified in the Response configuration, add a new step in the data transform and set .pyMetadata.pxMenuType to Replies as shown in the following figures.