Basic question, using a repeat server side

I’ve never used a repeat. So in trying too now, i have a paged database query and i have a column i’m returning called totalPrice from ticketProductsAll query, I’d like to use a repeat to get all of these and sum them up from all returned results.

So if 5 products are returned and have the following values (2,2,5) then the repeat value should be 9.

That’s not what’s happening. It’s returning null, so I’m using it wrong. How is it supposed to be structured?
image

To start with, ticketProdAllCalc.totalPrice doesn’t exist, the steps inside the Repeat will never run. You need to iterate the array ticketProdAllCalc, you cannot iterate ticketProdAllCalc.totalPrice as that’s undefined

Also, delete the Set Value expression as that expression is totally wrong and you should start from scratch after you fix the Repeat expression :wink:

Hint: You’ll need to use the “global name” in the Set Value