How to add numbers in Repeating Group?

Hi @riccardo.baravelli,

Honestly, I think the best way to do this is by saving these values in the database. I like to create two data types for this: Shopping Cart and Line Item.

Shopping Cart

  • List of Line Items (Line Item, list)
  • Customer Name (text)
  • Customer Email (text)
  • etc…

Line Item

  • Coupon (Coupon)
  • Quantity (number)
  • Total (number)

When a quantity is selected from the dropdown, create or update the line item for this coupon for this customer’s shopping cart: Total = Current Cell’s Coupon’s Price * Current Cell’s Quantity

This will allow you to add or subtract because the Coupon Sub-total is being re-calculated every time. Remember to add the line item to the current user’s Shopping Cart.

The input at the bottom of your screenshot would then be the current user’s Shopping Cart’s List of Line Items’ Total :sum

That’s a high-level look at how I’d approach this. It’s so much easier than messing with states because you have to take into account addition and subtractions and re-calculating every time a change is made.

Hope this helps!


Gaby | Coaching Bubble
Private coaching, courses, and tons of free resources

6 Likes