What's the correct way to use setif()? #920
-
Hi, On this codepen
with setif()
which doesn't work what's the correct way to tell mavo, which property it should apply the new value? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey there, The correct form of the In your case, it would look like this: |
Beta Was this translation helpful? Give feedback.
Hey there,
The correct form of the
setif()
action is:setif(condition, property, expression)
. So, you just add the new (third)condition
argument before the exsisting two arguments of theset()
action (and rename the action, of course 😊).In your case, it would look like this:
setif(quantity > 0, quantity, quantity - 1)
.