Chapter 5 · Flow and behavior
Formulas and conditions
Use variables, formulas and conditions so totals update and Pay can be blocked.
Watch the video
Follow along
Click where the blue ring is.
Step 1. On the detail screen, raise the quantity and the total follows at once.

Step 2. Quantity, price and cart count are number variables, all listed in Variables.

Step 3. In the total text, a formula sits inside double curly braces: quantity times price, shown as a price.

Step 4. The plus button is a Set variable reaction that adds one to the quantity, but only while it is below 9.

Step 5. Pay now has a condition group: payment is blocked when the guest is not signed in, or the cart count is 0.

Step 6. The group is set to Match any, so either one alone is enough to block it.

Step 7. Play it: paying with an empty cart sends you back to the cart, and with items the order completes.
