If you plan on using your bot to handle sensitive or personal information, you wouldn’t want to risk unwanted access to this information. The best way to prevent this is to use a form of validation to identify a user. This can be done in several ways:
-
When the user first speaks with the Bot, ask them to register by creating a pin/ passcode or password. Set this as an attribute. Before providing information to the user you can ask for the pin/passcode/password Use ‘Get attribute’ to make sure the value matches their answer!. (TIP use two flows. The first can webhook.)
-
Generate Random Number - This action does exactly what you’d expect - gives you a random number. This could be useful for generating passwords, or creating stock numbers (SKUs) or customer reference numbers. Of course, if you do that you should make sure you are confident the inputs you give allow confidence that you won’t get duplicates.
The two inputs to this action are ‘Minimum’ and ‘Maximum’, which define the two numbers between which your random number will be created, inclusive. As a simple example, entering 0 as the minimum and 10 as the maximum will return as an output, at random, one of the numbers 0,1,2,3,4,5,6,7,8,9 or 10. -
Use a Regex - A regex validation will allow you to compare the user’s answer against a value or previous output to validate the answer. This will prevent the bot from proceeding to the next task unless the user provides a ‘postcode’ that matches, for example. There’s an example of this in our article