How to direct a user through a different bot flow on their second visit (for WhatsApp/Messenger)

Xandro Lopez Updated by Xandro Lopez


In many cases, chat bots are used to qualify users by asking for information like their name, email etc. πŸ”

However, it can cause friction if users return more than once and have to answer these questions every time they interact with your bot.

Here you'll learn how to avoid the users that interact with your bot a second time from answering these questions again.

Capture the users first interaction

This step is very simple, you can read more about it in the How to capture and use the first user's interaction (input) in Whatsapp/Messenger article.

Create a "Set Variable" block and edit it so that it looks like it does below:

Set a Condition

The next thing we want to do is add a "Conditions block" where we will verify if this is the users first time interacting with the bot.

We created the variable @qualification but feel free to use a variable you feel comfortable with and set it up as shown in the picture:

User's first visit

If this is the user's first time interacting with the bot the variable will have no value so we will connect the red exit (false) to the qualifying questions flow.

At the end of the flow, add a "Set Variable block". We will use this block to give the @qualification variable a value.

In this case @qualification = yes

User's second or following visits

Since we gave the @qualification variable a value, the next time the user interacts with the bot it will recognise this and the flow will continue through the green exit every time.

Connect the green exit (true) to the to the second visit flow.

How did we do?

How to capture and use the first user's interaction (input) in Whatsapp/Messenger

Unblock user of error message loop and redirect to restart bot