Attributes save information about the ongoing conversation and help to reuse them in the chat.
Default Attributes
ChatBot automatically collects data about your users from integrated apps. Let’s use one of them to create a nice personalized Welcome Interaction. The following example uses the Facebook Messenger integration.
-
Create a new story and add an interaction.
-
Go to
bot responses
, addtext
and inside your response type double curly brackets to call the attributes{{ ... }}
. Keep Default and user attributes selected. -
Find Facebook integration and select
User name
. -
Add some text and save the interaction.
-
The attribute is ready. The bot will pull the information from Messenger and display the user name in the place of the attribute.
Collecting user attributes
User attributes allow you to store any value you want. To get the data you can use system or user entities. In the following example, we’ll be saving email address using the emai system entity.
-
Create a new story and add an interaction. Name it
Get email
. -
Add the
sys.email
entity to the user says section. To do so, type two curly brackets and select.sys.email
and name your attribute. FInd out more about this entity here. -
Add a few similar user says together with the entity.
-
Go to the bot responses section and add a new
text
response. Type again double curly brackets to view available attributes and select the one we’ve just created calleduser_email
. -
Save your work. Your attribute is set and ready.
JSON assigned to the parameter
.JSON assigned to the parameter
.Use Ask the Question action to collect attributes
You can prompt users to fill the attributes using the Ask a Question action. Ask a Question offers a variety of options, that can be used to gain new leads, collect orders and much more.
-
In the Interaction view, select Bot responses. Here you’ll find the Ask a Question action.
-
Configure the action. If you need help, please refer to this article.
-
Now you can reuse the value entered by users in your story. Type two curly brackets
{{ ... }}
. The system will automatically show you available attributes. -
Now save the interaction. When this bot response is triggered, the bot will display the value entered by the user.
How to fill Attributes
It’s possible to send any parameters during the ongoing conversation. They can substitute already existing parameters or create a new one that can be used at the specific scenario stage.
/query
or as an answer for incoming webhook. Attributes are used as metadata in archives./query
or as an answer for incoming webhook. Attributes are used as metadata in archives.