Bot activities can be designed to occur at any point in your conversation workflow. However, there may be situations where you want an activity to occur at random intervals. Instead of triggering the activity after every interaction, you can make the request appear occasionally or at unpredictable moments to avoid overwhelming the user.

Some examples of this implementation include:

To set an activity to occur at random, please follow these steps:

  1. In UI Builder, select the intent where you want to add the activity.
  2. In the Design pane, add a Branch: If/Else Condition.
  3. In the Details pane, select Add an Expression in the Condition field.
  4. Replace the equals sign with this code:
rand(1,5) == 2
  1. In the True branch, add the activity that you want to trigger randomly.
  2. Save your changes and test using the Test Bot.

The condition rand(1,5) == 2 tells the chatbot to assign a random number between 1 and 5 each time it runs. When the number 2 gets assigned, the condition is met and the activity is triggered.

The video below demonstrates how to create a "rate your experience" feature that is activated at random to ensure a great customer experience with your conversational AI. In addition, you will learn how to apply this behavior only to the channels of your choosing (in this example, just to a website chatbot).