Example: using counters and conditions

This example counts the number of times an interaction is shown to the user and then uses a condition to decide whether to show the interaction again or whether to advance the conversation by showing a different interaction. It uses two types of action:
  • A counter variable to count the number of times a user has seen the Not current range message.
  • A condition to determine the next step based on the value of the counter.

This shows the full example:

The counter is incremented whenever the Not Current Range message is triggered. The following Message seen? condition evaluates the counter. If counter > 1 it advances the conversation by showing the Tell us more question otherwise it automatically redisplays the Favorite flavor message.

Important: This example uses messages rather than question interactions. This is because the bot will not advance the conversation until the user has answered the question.