Creating A Running Total

I am very new to Bubble and perhaps still stuck in an Excel mindset. I know this is a rookie question, but it’s driving me crazy!

On my page, I have a Repeating Group with text cells to display a TaskTitle, a DaysTilDone field (anticipated number of days until the task is done), a DaysSum field (a running total of DaysTilDone up to that point), and finally a DueDate field. TaskTitle and DaysTilDone have values that come from input elements. DaysSum and DueDate are derived based on calculations. They are all part of a project with a given StartDate.

My ultimate objective is to be able to display the task, it’s DaysTilDone value, and the DueDate using StartDate +Date:X. But calculating the running total “X” is where I’m having great difficulty. Someone advised that all I needed to do is create a field like DaysSum and from my “New Task Save” button Workflow add each new DaysTilDone value to the DaysSum field using the “last record the running total”. That makes complete sense to me, but I cannot find any option that lets me access the “last record” in a repeating group. I have absolutely no idea what to do. Any help would be greatly appreciated.

Lets say that your rg is “repeating group A” and the type of content is “thing” where one of the fields is a date of type date

Try this expression inside a text element and preview it > repeating group A’s list of things: last item’s date

…Worked like a charm. Thank you so much. You really made that seem easy. Much appreciated.

1 Like