Where are triggered intents stored?
# 🤝help
g
I want to reference an intent name that can be used further down the flow. For example, if a user says I wanna buy electronics, the intent node routes the user to the electronics node. But I need to be able to store the intent name ("Electronics" in this case) to check an external Google sheet to check whether electronics is actually available. I'll need an exact match of the intent name for this.
c
hi there. What I would do in your case is assign a new variable with that intent as a value e.g.
Copy code
js
let intent = "Electronics"
The simplest method is to duplicate this code and assign a different value depending on the intent so if the intent is "Software":
Copy code
js
let intent = "Software"
Alternatively there are different methods of doing this in code format but I would recommend this simpler approach. Once you capture the
intent
variable you can pass that along to make.com or do a query on your database to see if this product/category exists. Hope that helps !
g
Interesting approach. I'm gonna try this. Thanks a lot!
Hey @cold-jewelry-54343 , this works great. My issue is since botpress doesn't allow connection to specific blocks in a node, I'll have to create separate nodes for each block for proper routing. This would get really messy. Finding a way to reference intents still sounds like the best approach, but I'm gonna use your approach until I find a way to do that.
c
Can you post your flow ?
g
as you can see, I'm setting a name for each intent inside a session variable, then using If statements to route to appropriate categories.
Using the same process with products would be atrocious since the number would be increasing. This is just a demo
Also, the query KB and AI you see on my products is just a trial and I'm trying many things to make extracting the name of the product possible. In this case, I have made a KB with just the product names, and the query card looks inside the KB to find a match and output it.
c
ah so instead of using intents You could provide a single choice card and flow depending on the specific choice (in your case meat, Shelfish, Freshwater Fish). Than afterwards you can either present your knowledge in a Carousel/List or present your dishes in text. If you want to have an open-ended conversation without buttons to click: in this case an AI node could extract which category is being desired: e.g. "I would like to eat a steak meal" , Ai can extract : category=meat, dish=steak. In your cause a menu would make more sense since you only have n amount of dishes (lets say 10 meals). Generally speaking I use the intent more for "cancel" "redo" (command intents related to the actual bot itself, not the content within).
3 Views