Multiply a product variable (price) and its result add it to a subtotal variable | Community
Skip to main content
Answered

Multiply a product variable (price) and its result add it to a subtotal variable

  • February 19, 2021
  • 2 replies
  • 613 views

sebastiancv
Forum|alt.badge.img

Hi, I have a question related about subtotals. 

My typeform is a shopping cart, with 4 kind of groups of services, each services are integrated with several products. I need to get 4 different kind of sub totals and adds each subtotal to the score at the end of the process. 

I created a variable to each product (each with its price)
And created a variable to each subtotal (each with value 0 -zero-)

here my question:

  • Can I multiply a product variable (price) and its result add it to one of the subtotal variable?

thanks in advance

Best answer by john.desborough

@sebastiancv - this is from a user of Typeform

while not exactly identical to your use case, the thread at this link here shows how ‘math logic’ was used to make calculations .. 

that might help move the needle a bit.. until someone from the Community team can fill in the blanks in a more fulsome fashion

 

des

View original

2 replies

john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5268 replies
  • Answer
  • February 19, 2021

@sebastiancv - this is from a user of Typeform

while not exactly identical to your use case, the thread at this link here shows how ‘math logic’ was used to make calculations .. 

that might help move the needle a bit.. until someone from the Community team can fill in the blanks in a more fulsome fashion

 

des


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14893 replies
  • February 19, 2021

Hi @sebastiancv ! The link @john.desborough shared is a good workaround for this. One thing I’ve been made aware of is that our calculator has some unexpected limitations to it that are a little tricky for the developers to fix, so something to note in the meantime: 

• Calculations associated to an Always conditions are executed when the Typeform is loaded and not when the respondent reaches the given block, therefore causing unexpected behavior.
• The work around is to attach an IF condition to the calculation. This way, the calculation will only be executed when the respondent reached the block with the condition attached.

This may or may not end up applying to your setup, but I wanted to share with you just in case!


Reply