Back to Blog

How to handle multiple messages from users or customers

When you’re trying to capture a message from a user you may encounter a scenario where they answer in more than 1 message. When your bot proceeds with the next step without letting the user finish their message you might lose useful information. Therefore, it is recommended to create a different set-up. Especially for cases where your are gathering information to push it to a customer service tool.

In this article, we propose three solutions to give the user the chance to finish their message before proceeding;

Ask for 1 message

This solution is very primitive and simple to implement. The downside is that this solution won’t be perceived as a natural conversation.

How it works: Within the Bot’s text reply indicate to deliver only 1 message.

Handle multiple chatbot messages

Indicate when finished

When you want to give your customers a bit more space you can allow them to send several messages. This leads to more complex design. Even though the user should indicate when “Done” it feels more natural than the first solution.

How it works: The parameters that you can fill are lists. Multiple messages by the user will add messages to the list. When the user types “Done”, we know that the list is completed and we can continue.

You can use the following code to check if the user types “Done” and redirect to the right event. Make sure to adjust the names of your parameters and events.

async payload => {
  if(Array.isArray(payload.params.message)) {
   message = payload.params.message[payload.params.message.length - 1].value
        if(message == "Done"||message == "done"){
        } else{
Handle more than one chatbot messages

Wait for input

The third and most natural solution gives your users time to create several messages. The design is more complex than the first solution and is also more error prone than the previous two, especially when there is a large difference between the type of users. One person can type much faster than the other.

How it works: Similar to the previous step we add several messages to a list. Whenever the bot does not receive a new messages within 5 seconds (or more depending on your case) we can assume that it’s safe to proceed to the next step.

Handle several user messages
Get StartedContact us