absent-sapphire•2y ago
button on click
I am working on a bot that has questions with buttons to choose the answer, I need that when the user clicks on their answer (the button) the choice is saved so that later with IA an answer is created based on the answers of the users. buttons, I did it this way but it doesn't work. It is worth clarifying that it has a knowledge base and that the answer comes from there.

9 Replies
To save a user's choice when they click a button in your bot, and later use those choices to generate an answer from a knowledge base, you need to ensure your setup is correctly configured. Here's a simplified guide based on your requirements:
- Use Buttons to present users with options. Buttons allow users to make selections without typing, streamlining the interaction.
- When a button is clicked, you can configure it to perform actions such as navigating to another part of the flow or attaching an intent. This is crucial for saving the user's choice.
- To save the user's choice for later use, consider using Captures to record this information into an entity. This data can then be processed or used to query your knowledge base.
- Ensure your Knowledge Base is correctly implemented and updated. You can add sources to your knowledge base and set refresh rates to keep the information current.
- Use the knowledge base to generate answers based on the user's choices. The system prioritizes responses from Intents, then the Knowledge Base, and finally, a global no match message if no answer is found.
Remember, buttons and captures are key to creating an interactive and responsive user experience, while your knowledge base serves as the foundation for generating intelligent responses based on user inputs.
For more detailed guidance, you might find these resources helpful:
- Adding User Input
- Implementing the Knowledge Base
absent-sapphireOP•2y ago
How can I configure a button?, i also tried to use capture this way, but it didnt work very well.

absent-sapphireOP•2y ago
can i capture a click on the button to save the answer?
Use the Buttons step to create buttons.
Use the built-in {last_utterance} to get the button label/value
absent-sapphireOP•2y ago
so i set the variable {last utterance} in all the buttons and then i conect that with the next question?
absent-sapphireOP•2y ago
i set it this way, but it didnt work

absent-sapphireOP•2y ago
i set {last_utterance} to the general variable of the question, and that is conected with the question in the ia knowleadge. i tried but the bot has no answer. what am i doing wrong?
Are you passing the {last_utterance} in your question or instructions?
extended-salmon•2y ago
From your screenshots it looks like you create 4 variables for each pregunta. Maybe you could create only 1 variable for each pregunta with 4 different values "a", "b", "c" and "d".