Integer number entity

Daria Zaboj product content specialist
Daria Zabój
4 min read
updated: May 27, 2022

Help your chatbot recognize integer numbers.

The integer number entity is a system entity that helps your chatbot identify when the user writes the integer number.

How does the integer number entity work?

The integer number entity must contain integer numbers (e.g., 1, 7, 97, 3073). When the user enters some numbers in a chat, the chatbot compares it with the integer number entity and checks which number is the integer number.

The integer number entity lets you automatically validate numbers. You can save them as attributes and use them later in a conversation; for instance, to confirm orders in your online shop, prices, and more. Data gathered through attributes can also be sent to external services so you can reuse it for other purposes. 

How to use the integer entityLink icon

Type double curly brackets {{ to trigger the entity window and select the one you need.
Type double curly brackets {{ to trigger the entity window and select the one you need.

Let’s say you run a restaurant, and you let your customers order pizza by using a chatbot. The system integer number entity can help your chatbot verify how many pizzas a customer wants to order. 

  1. Open a Story you want to use to collect orders from your customers.integer entity

  2. Add a Bot response in a place where you want to let the customer select their pizza.integer entity

  3. Open the Bot response and add some Text and Gallery responses to present different types of pizza to the customer. integer entity

  4. Open the button field in the card — type in the Button title, and select Send message in the Button type field. Then, add the Postback value — a type of pizza the user can order. Repeat this setup for every card. integer entity

  5.  Next, add the User input after the Bot response to collect the user response.  integer entity

  6.  Open the User input and select the double curly brackets to trigger the entity window. integer entity

  7.  In the Parameter validation field, select the Any system entityinteger entity

  8. After verifying the user’s reply, you can save it as an attribute. To do so, select the Save to attribute and create a new pizzaType attribute. Then, click the Add attribute button. integer entity

  9.  Now, you need to ask the user how many pizzas they want to order. To do so, add the Question action after the User input you added. This action lets you add multiple questions and collect user input at once. integer entity

  10. Open the Question block. In the Question variants field, type your question. You can add a custom pizzaType attribute to confirm the data you gather in the User inputinteger entity

  11. Now, in the Validate response with entity select the Integer system entity. This way, your chatbot can recognize integer numbersinteger entity

  12. Once the user response is validated, you can save it into an attribute. In the Save response to attribute field, add a custom pizzaNumber attribute**.** integer entityinteger entity

  13. Now, in the Action on failure input, decide what should happen if the user fails to provide the integer number. integer entity

  14. After collecting the user response, your chatbot can confirm the collected data with the user. To do so, add a Bot response after the Success block. integer entity

  15.  Open a Bot response you added. Use the collected attributes and compose the chatbot’s reply. integer entity

  16. You can make your chatbot’s communication more accurate by adding filters. Filters let you display a different message to users depending on the information they provide. So, let’s say you want to send a dedicated message to users who order just one pizza. To do so, select the Add filter button. integer entity

  17. In the Attribute name field, select the pizzaNumber attribute. Then, add =equals in the Condition section and set Value to 1integer entity

  18.  Now, you can create a message for users who order more than one pizza. To do so, add another Text response and write the matching chatbot reply. integer entity

  19. To display a message only to users who order more than one pizza, select Add filter. integer entity

  20.  In the window that appears, select the pizzaNumber attribute. Then, set up the condition to be greater than 1. This way, your chatbot will show this message only if the user orders more than one pizza.integer entity

  21. Finally, test your Story to verify whether everything works as intended.integer entity

    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