Bubble Calculations in a repeating group with more than one row

I have been back using Bubble after several years away from it over the weekend. I remember it being a helpful tool.

Can anyone remind me how I add up a “column” in a repeating group with a varying number of rows and put the total in a text box outside the group? I’m building a weight loss tool where you select what foods you’ve eaten, type in how much and it displays calories, carbs in that amount etc in the repeating group. I’ve got the RG working and can put the total amount of calories etc in each row but I want to display how many calories in total you’ve eaten and how many you’ve got left that day/week etc. I’ve been using custom states to do this but I can only get it to work where there is only one row in the repeating group. As soon as there are two or more foods, I can’t calculate the total. Can anyone help? I’ve looked at lots of different examples and questions here and I must have missed something because what I’m doing doesn’t seem very advanced at all given what other are doing with Bubble.

You need to get the plugin BDK Repeating Group Tools. Unfortunately, this is not natively available in Bubble

EDIT: Yes, @BrianHenderson is correct if you are not making any calculations within the repeating group. But if you are, you’ll need the BDK plugin.

1 Like

Each row will need to be tied to something in the database, not just custom states in the user’s browser. Then it’s just a matter of using :sum to get what you need.

1 Like