How to set Numeric Variable Condition

Does anyone know how I can set a variable to not go under a certain value?

In the example below I am using 2 numeric variables: Total and Quantity. I set the following triggers:

• Adjust Total -< Subtract 5.99 when user clicks "-"

The total continues to subtract even if the value goes lower than zero. Any idea what triggers or conditions would help me solve this problem?

Thank you!

4 Replies

Hi Liliana,

You should be able to add a condition to subtract 5.99 ONLY if total is not equal to 0... I'll put something together for you.

Oh David that was so easy, I think my brain was just too tired. I'm building something for this week's challenge! so much fun :)

I set the condition and now it works as I wanted it . Thank you again

Hi Liliana!

I spent a little time working out an example that you might find helpful. It calculates two items at different prices. You can add and subtract as many of each item as you like. If you have no items added, then the condition will prevent your cart from displaying a negative value.

Can't wait to see your example next week!

Storyline 2 source file attached

Preview example

Thank you David,the example is really helpful and gave me some new ideas. I haven't worked that much with numeric variables so the ELH challenge is a good opportunity to learn and practice. To give a hint, I am building an example on McDonalds's self-checkout kiosk. Will share it soon!