How to calculate a total from input field items in a repeating group

Is there anyway to calculate items within a repeating group list of user input values, using custom states?

I have a repeating group with a group that holds a price input field, quantity input field, subtotal field (which is the product of the price and quantity input fields from the user), and delete button. How would display the total of all the repeating group cells outside the repeating group, while accounting for when a user changes the pricing and/or quantity fields (i.e., the subtotal) AND if a user deletes a cell, using the delete button?

Iā€™ve been trying to do this with custom states, but I am at a loss. Please help :sweat_smile:

----Adding a video recording of whatā€™s happening. I thought this would help since what I have doesnā€™t seem to be super complicated using custom states, I think Iā€™m just missing something.

The repeating group displays a list of entries that already exist in the database, and when the user changes the value of an input, the related field will be updated in the related entry, if this is your case, then you can use an expression like this:

You can easily do this with Energizer. Demo is currently in works, and this used to be called Scoper.

Energizer can do what Element Scoper did plus more now, and it is its own independent plugin called Energizer.

You just put the Energy Pod in your RG, assign and you can track anything that happens from within a cell or send triggers directly to it.

Oh, and itā€™s free.

1 Like

Troubles with calculations

Hello! thanks for the input. I added a video recording of whatā€™s happening, to give you an idea of my problem. Iā€™m basically trying to store values in custom states within a repeating group, and get the resulting data outside of the repeating group to display the running total, while accounting for if/when a user deletes a line item. It seems like this can be solved with some math, but I suck at math lol. Anyway, linking the video below.