https://discord.gg/botpress logo
Hi everyone 👋
# 🌎general
a
Hi everyone 👋 I have an idea for a chatbot I’d like to build with Botpress: The user would say what kind of activity they’re looking for (e.g. date, type, location, etc.), and the bot would search a database to suggest matching activities. My problem is, I’m not sure how to query and loop through the database to filter results based on the user’s criteria. Could anyone point me to the right approach or share an example/tutorial for doing this in Botpress? 🙏 Thanks in advance!
p
If you are planning on using the botpress knowledge base, we have cards that allow you to do so (e.g. query kb and search kb). You can also make a table for all the activities and search through it with a find records card. Happy Bot Building!
a
Hi again 👋 I tried using the Query KB card, but it’s not returning any results. Is there any specific configuration I need to set up, or any way to optimize the data in the Knowledge Base so the queries work better? Thanks!
p
You must output its results, by printing the variable it is stored in. Hope this helps!
a
Hi I’d like to filter results from my data using multiple variables/conditions. For example, I have a price field in my records, and I only want to return results where the price is lower than the value provided by the user. How can I set this up in Botpress? Is it possible to apply conditions directly in the Find Records / Query KB card, or do I need to handle this with custom logic after fetching the results?
@prehistoric-airplane-85682
p
So, there is a field in the find records card for your query/conditions and the query kb card can take in any text so you can specify as many conditions as you'd like. Hope this helps!