What is a property?
The core purpose of the bot is to collect information from the user and keep track of user preferences and requirements. The pieces of information like Phone Numbers. Email IDs , date of Birth and many more, that are shared by the user, are stored on the platform for further use in the form of Properties that make up user's profile.
How to create a new property?
You can create a property in the Chat Flow > Property tab by clicking on the 'Create Property' button.
You can also create a property in the Chat Flow > Conversations tab simply by typing two curly brackets followed by the name of the property in the Set property block or in any of the text messages.
Click on the 'Add' button highlighted above to create a new property named 'First'. A property can be a text, date, number, decimal, phone number, boolean(true/false) , location or an object (image).
A property can be of two types :
- Customer Property
A customer property can be used to save attributes related to a particular user. All these properties can be viewed in the user' profile in the Audience tab. Values for these properties will remain saved until and unless specially changed.
- Session Property
Similar to the session variables used in coding languages, these are session level properties and cease to exist once a session of interaction is completed.
How to store a value for a property?
You can store properties in the Chat Flow > Conversations tab. There are multiple ways of storing properties on the platform:
- 'Set Property' block
You can refer to Set Property block.
- Store user response in a property
You can save users responses in a property by using the toggle switch 'Store user response in property?' as indicated by (1) block in the below image.
Once the toggle switch is turned on, you can add a validation for the user message as indicated by (2) block in the below image. These validations can be of multiple types, here we have chosen 'Free text' and added the list of values that prevents the user from providing a response other than the list. We will talk about validations in detail later in this chapter.
Once you have added the required validation, you can now choose the property name where you want to save users response as indicated in the block (3) in the below image. In case the required property is not existing , you can create a new property in this block, by clicking the 'Add' button.
User can either click on any of the Quick responses provided or he can type the name of the city manually and the response will be stored in the property
The platform provides an option, where you can also prevent the user from typing the response for any particular question from the keyboard and only choose one of the QRs provided. You can do this using the 'Allow user to type anything' toggle switch s shown in the below image. It is switched on by default.
You can turn the switch off, hence preventing the user from using the keyboard to provide a response. If you turn this switch off, and the user types anything, the sends a default error message asking the user to choose one of the options provided in the form of QRs.