How to use attributes

Agnieszka Dudziak
Agnieszka Dudziak
4 min read
updated: Jan 10, 2024

Attributes can save user information and allow for reusing it in conversations. In ChatBot, we can distinguish default and custom attributes.

Default attributesLink icon

ChatBot automatically collects data about your users from integrated apps. Let’s use one of them to create a personalized welcome message. The following example uses the ChatBot and Messenger integration.

  1. Create a new chatbot. Then, click on the Bot response block called Welcome message.

  2. Remove the default message. Add a new text response and click on the curly brackets symbol {...} to call the attributes.

  3. Click on the Name attribute to use it. Add some text and save the interaction.

  4. The attribute is ready. The bot will pull the information from Messenger and display the user name in the place of the attribute.

Custom attributesLink icon

If you need to collect user data that isn’t listed in the default attributes list, you can create your own custom attributes.

  1. Click on the curly brackets symbol {...} in the User input or Bot response. Then, click on the + Add new.

  2. Here, you can name your custom attribute.

  3. Then, click Add attribute to save it.

Collecting user attributesLink icon

User attributes allow you to store any value you want. To get the data, you can use system entities or user entities. In the following example, we’ll be saving the email address using the Email system entity.

  1. Create a new chatbot.

  2. Add a new User input block to your Bot response.

  3. Open the User input block. In the User says section, type two curly brackets or click the curly brackets symbol. Select the Email parameter validation and Save to Email attribute. Then, click Done.

  4. Close the User input block and add the Bot response block to it.

  5. Open the added Bot response and add a new Text response. Once again, click on the curly brackets symbol to view available attributes. Select Email from the list.

  6. Save your work. Your attribute is set and ready.

Use the Question action to collect attributesLink icon

  1. You can encourage users to fill in the attributes using the Question action. Learn more about the Question action or see our Question Academy lesson.

  2. If you ask the user their email address by using the default_email attribute in Question, you can use that information in your bot responses later in the chatbot. If the user’s email address has been collected successfully, you can add the default_email attribute to the bot’s message.

Use buttons to save attributesLink icon

  1. Button actions allow you to add special events that are triggered when the button is clicked. For example, you can save an action the user made as an attribute. Button actions are invisible to end-users.

  2. Select Actions, and then {…} Set custom attribute.

  3. Now, SET custom attribute TO the value from the button.

Use the Set attribute actionLink icon

You can save attributes at any point in your chatbot by dragging the Set attribute block from the Actions menu.

  1. Place the Set attribute block after the chosen User input to save it.

  2. Click on the Set attribute block to edit it. Choose a custom attribute or pick any from the list of default attributes. You can also create a new custom attribute.

  3. Name the attribute. This way, you will easily find it and can reuse it in your chatbot. Then, click Add attribute.

  4. Now, SET the attribute TO your chosen value.

Attributes sectionLink icon

How to navigate to the Attributes section?

  1. Go to the chatbot view in your dashboard and choose the Settings icon.

  2. Click { } Attributes to open the Attributes section.

  3. Attributes can now be set to be saved in the user’s data, so when a new chat starts, the attributes will be remembered.

  4. If you need to collect user data that isn’t listed, you can create a custom attribute by clicking + Add new.

  5. You can see in Archives that the attributes are assigned to the user.

Read more:

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

We’re happy to help.

Start a free ChatBot trial
and build your first chatbot today!

Free 14-day trial No credit card required

Discover our text| products