https://discord.gg/botpress logo
Calculate Pricing
# 🤝help
a
Can we train the bot so that it calculates something based on user input with refernce to predefined data? If yes, how?
p
Are you aiming to use an AN because you can definitely achieve this with it?
a
@prehistoric-airplane-85682 What I am trying to achieve is to feed the bot with some pricing, like for Item A, which is USD 500, and Item B, which is USD 700. And then if users ask, "I want 3 Item A and 5 Item B, what's the pricing?" the bot can answer that, and will it be possible?
w
Create an action that takes as input a price and quantity (or an array with several elements quantity price) and then write a simple Js code that does the calculs
a
@wooden-beard-40210 can you please share any screenshot from botpress to add the code to the flow
This is sorted with AN, thanks @prehistoric-airplane-85682
p
No worries!
2 Views