Attributes save information about the ongoing conversation and help to reuse them in the chat.
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.
Check out the list of default attributes.
- Create a new story and add an interaction.
- Go to
bot responses, add
textand inside your response type double curly brackets to call the attributes
Default and user attributesselected.
- Find Facebook integration and select
- 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
- Add the
sys.emailentity to the user says section. To do so, type two curly brackets and select
.sys.emailand 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
textresponse. Type again double curly brackets to view available attributes and select the one we’ve just created called
- Save your work. Your attribute is set and ready.
You can pass the value of your attributes by webhooks. You'll find it in the
JSONassigned to the
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.
Parameters can be sent either in endpoint
/queryor as an answer for incoming webhook. Attributes are used as metadata in archives.