How to calculate the sum of inputs within a Repeating group?

Two methods I can think of.

A. As the input’s value changes, use a workflow to manage a list of prices in a custom state.

Because list operations like :plus item automatically take out duplicates, using a list of numbers isn’t great if the user enters the same price for two or more. So instead, make each item a unique text.

Then outside the RG, the list of unique texts needs to be split back into just the prices for summing.

demo page editor, sum repeating group inputs without saving to database

demo page runtime

image

B. You can use javascript to grab each input’s value and sum them. If you like coding, this method makes sense.

6 Likes