https://discord.gg/botpress logo
#🤝help
KB auto update from outside source
# 🤝help
c

careful-businessperson-24517

12/20/2023, 5:54 PM
if i have a price table in KB. For example, it includes product name, quantity, and price per unit. First question: If a customer requests three units of one product and two units of another product, how can I make the bot calculate the total cost? Second question: If I have a Google Sheet outside Botpress and I want changes made in the KB Botpress price table to automatically update in the Google Sheet without using something like MAKE, is it possible?" @User @famous-jewelry-85388
c

crooked-ram-87124

12/20/2023, 8:49 PM
@careful-businessperson-24517 you tagged the right one for sure, however since I had a second I think I know the answer to question 2. I do not think there is a direct integration for Google sheets - yet- as you stated it requires Make, Zapier, Pabbly, etc. The first question is actually a bit trickier. in order for that to work you need to pull the values from the table. Maybe an execute code and store the price per as a variable, then how many are available. The other part of this equation is having the bot know that if table quantity is 0 then the customer can not purchase any. Once the variables are stored though you would be golden. I have not programmed any variables to be used mathematically but so long as they are stored as numbers I do not see why that would be an issue, I do imagine a few hours of tweaking execute code cards and ai task or ai text generate cards in some fashion to tie all together with capturing which item the user wants and how many, then is it available before performing the math.
f

famous-jewelry-85388

01/08/2024, 6:51 PM
@careful-businessperson-24517 Am I still needed?