https://discord.gg/botpress logo
#🌎general
Title
# 🌎general
h

hallowed-waiter-46283

07/01/2023, 4:46 PM
How can I code it so when a user, instead of selecting a predetermined button I set, says something in the chatbox and I want to save what the user said in a variable and lead the node flow to another node?
e

early-train-33247

07/02/2023, 12:46 AM
You could add a "always" transition below the capture card that goes to another node. And in that node you could access the input using the
event.preview
variable
You could also turn on the "Add transition to handle failure" advanced config option of the Capture Card, and have the conv transition to another node where you check the value and apply your logic
h

hallowed-waiter-46283

07/02/2023, 11:17 PM
I managed to do something like this:
I managed to make a fallback (by making number of retries to 0 and adding a expression) so when a user doesnt click on one of the predermined buttons (eg. paid ads and SEO as shown below) and just says something else it goes to another node. Now, I want it so that in that node it reads the user message (which in most cases is a question like shown in the image below) and check the knowledge base and give an answer. How would I go by doing that?
Is it even possible 😭
e

early-train-33247

07/04/2023, 12:58 AM
Hey @hallowed-waiter-46283, you could turn on Knowledge Answering in the askservice node, so that if they ask something present in the Knowledge Base, it will answer and ask the question again
That way you would leave the transition for all other cases
h

hallowed-waiter-46283

07/04/2023, 1:47 AM
Yep I know. But I also wanted to use a third party app like StackAI to do the query if the knowledgbase fails, so thats why Im adding that extra node.
e

early-train-33247

07/05/2023, 12:35 AM
Got you! Then you can just add a Execute Code card in that node that makes a request to your Stack AI KB.
Unfortunately there is no way to trigger the Botpress KB's at will at the moment.