# Anticipate user actions outside of the communication scenario

# Set up Global Actions (RWC)

When you implement the communication scenario in messages, your bot leads your user through the conversation. It is the best practice in conversational design. The flip side of the guided conversation is that the user can do nothing but reply to the bot's messages. What if a user needs to do another action in the chat? For example, your communication scenario does not cover a rare use case, which is why the conversation becomes irrelevant to the user. In this case, we anticipate the user closing the chat or asking for help from the human agent. You can complement your chat with these actions. Use the Set up Global Actions (RWC) Step template to add these user actions to the chat and build the logic to process them.

In this Step, you can set up three user actions that will be processed as Global actions:

  • closing or reloading the browser page
  • typing a set word in the Text field of the chat
  • clicking the added button available in the chat aside from messages

image

Once a user does one of these three actions in the chat, it will trigger Global action execution, if you configured the Step accordingly. For example, you can let the user request help from the human agent by clicking the Help button or sending a message with the "Help" word via the Text field anytime during the conversation. The user can always close the RWC browser page or App, but you can create a Global action to process chat closure with extra logic.

The Set up Global Actions (RWC) Step lets you build the Global action processing in the Flow or on the client. To execute Global action logic in the Flow, set up Global action to be processed as a Command, then the Set up Global Actions (RWC) Step gets an extra leg, where you can add the necessary Steps and build the logic of execution. For example, you want to collect statistics about users' dropouts in the middle of the conversation and follow up with these users in another communication channel, like email or SMS. It is possible to build this logic only in the Flow. That is why you need to turn on the predesigned Process chat close event Global action and choose to process it as a Command. On the newly-generated leg, add Steps that record user dropout data and send them a follow-up email. It is possible to build this logic only on the extra leg in the Flow. Same with the Help button and the "Help" word text command to request assistance from the human agent in the chat. Their logic can only be built with the means of an extra leg.

Meanwhile, when Global action manipulates chat page resources and chat frontend, it is better to build Global action execution on the client. The Set up Global Actions (RWC) Step allows building Global actions that run JavaScript code execution right on the chat page. For example, when the user closes the browser chat page, you may need to clean its local storage and delete the cookies. To set it up, turn on the predesigned Process chat close event Global action, choose to process it as JavaScript code, and write the necessary script. Another example is to complement the chat with a button that increases its font size to adapt a chat for people with visual disabilities. To create this button, add a custom action in the Step, choose to process it as a Button, set up its Icon and Lable, select JavaScript code as an Action type, and finally, provide the script that changes the chat font size.

All in all, Global actions complement the communication scenario between the user and the bot. A user can type a command to a bot, click a button, close or reload the chat page. These actions are processed either in the Flow or on the client according to their architecture. Global actions serve as an addition and alternative to what a user can do in the chat aside from replying to the bot.

Last Updated: 9/1/2023, 2:00:19 PM