# How to pull out data from a repeating table and make a sum of them

**URL:** <https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914>\
**Category:** Need help\
**Created:** [November 4, 2024, 10:11am UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914 "2024-11-04T10:11:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 4, 2024, 10:11am UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/1 "2024-11-04T10:11:59Z")

</div>

im a little stuck here and dont know how to make this work…

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/0/7/074ba78abbe4e0d89e84bc2c8ae74f45722fb2ff.png)  
as you see on this picture a have a repeating table there calculates services price for each line…

but where im stuck is that when i try to make a sum for each line in the “subtotal” i cant figure how to pull the data out from the repeating group to make a sum of them,

can anyone help me out? 🙂

---

<div class="post-metadata">

**Author:** ![stephane\_hildbrand](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/stephane_hildbrand/32/209881_2.png) [@stephane\_hildbrand](https://forum.bubble.io/u/stephane_hildbrand)\
**Post date:** [November 4, 2024, 10:36am UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/2 "2024-11-04T10:36:59Z")

</div>

When manipulating your repeating group list of things you should see something like that : repeating group’s list of things:each item’s {parameter}

In that way you can get a list of prices from your list of things. (or any other data field you may need)

From that, you just sum the list of prices or do whatever else you need.

---

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 4, 2024, 10:43am UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/3 "2024-11-04T10:43:16Z")

</div>

hi @stephane_hildbrand  
thank you for quick repsonse  
but my issue is that the price is only a text element with a calculation in  
like this:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/7/0/7083ed5e3cd97c92b775092cf6214ae46a673cab.png)

so it is not a data field because the total price for each line is varibale depending on amount and price per unit…

so is there any way i can tak the value of the text element in the repeating group and make a sum of that?

---

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 4, 2024, 12:59pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/4 "2024-11-04T12:59:45Z")

</div>

![image](https://us1.discourse-cdn.com/bubble/original/3X/5/1/51901ae695f297ab0139a0de474e9db16b7ea0c7.png)

@stephane_hildbrand  
i can only get so far in the expression becasue its not a field

---

<div class="post-metadata">

**Author:** ![stephane\_hildbrand](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/stephane_hildbrand/32/209881_2.png) [@stephane\_hildbrand](https://forum.bubble.io/u/stephane_hildbrand)\
**Post date:** [November 4, 2024, 1:49pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/5 "2024-11-04T13:49:20Z")

</div>

You can not reference to a text within a repeating group.

You’ll have to do the calculation again for the sum.

Or you might want to create objects into the database for each line and then refer to those elements for any further calculation.

---

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 4, 2024, 2:13pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/6 "2024-11-04T14:13:35Z")

</div>

hmm… how do i then make the calculation for each line and put in to the databse…?

because these lines are only temporary lines there gets added from values of a product and service database… so when i click on on them from a list they get added to the lines you see above… but as soon as the offer gets created it deletes the lines from the database and clear data ready to a new offer getting created

---

<div class="post-metadata">

**Author:** ![pogerefelipe](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pogerefelipe/32/256000_2.png) [@pogerefelipe](https://forum.bubble.io/u/pogerefelipe)\
**Post date:** [November 4, 2024, 2:17pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/7 "2024-11-04T14:17:58Z")

</div>

I haven’t done it before, but i’ve seen some users using plugins to do that!

---

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 4, 2024, 2:30pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/8 "2024-11-04T14:30:26Z")

</div>

yeah i tried some of the calculations plugin… but they doesnt show a result… so its either me there doesnt understand how they works or that they just doesnt work 😅

doint the calculation in a text element is the only thing i have got to work as intended

---

<div class="post-metadata">

**Author:** ![agoulas](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/agoulas/32/158622_2.png) [@agoulas](https://forum.bubble.io/u/agoulas)\
**Post date:** [November 5, 2024, 3:54am UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/9 "2024-11-05T03:54:54Z")

</div>

> [@Sum of inputs from a repeating group](https://forum.bubble.io/t/sum-of-inputs-from-a-repeating-group/149832):
>
> Hi bubblers! I have looked for hours to find a solution but it doesn’t seem there’s an easy one in the forum except using the bdk plugin. I have a repeating group in which I have inputs. I do calculations in these inputs. I want to have the sum of all these inputs that are in the repeating group. It seems crazy to me that there’s no build-in solution, to sum up, all inputs from a repeating group. Does anyone have an easy solution to implement? Thanks!

---

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 5, 2024, 2:22pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/10 "2024-11-05T14:22:58Z")

</div>

hi @agoulas  
thank you for you post… i have tried now to go study more about the states… and it seems the states have to be triggered by a button or a link before working… that doesnt work for me unfonuatually… i need it to be calculated automatic when new values get entered… as it does now in each line when qty get typed in

---

<div class="post-metadata">

**Author:** ![agoulas](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/agoulas/32/158622_2.png) [@agoulas](https://forum.bubble.io/u/agoulas)\
**Post date:** [November 5, 2024, 2:52pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/11 "2024-11-05T14:52:48Z")

</div>

> [@christian\_bargmann](#):
>
> ggered by a button or a link before working… that doesnt work for me unfonuatually… i need it to be calculated automatic when new values get entered… as it does now in each line when qty get typed in

You would create a work flow “when a input value has changed” then set states. Look at this editor. [Rhbsandbox | Bubble Editor](https://bubble.io/page?type=page&name=shopping_cart&id=rhbsandbox&tab=tabs-1)

---

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 5, 2024, 3:42pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/12 "2024-11-05T15:42:58Z")

</div>

hmm… i have tried to take a look at the sandbox you sendt… and that is actually how i want it to be… but in you setup i cant see any calculation or how you have got it to calculate it…

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/8/d/8de2e09a3a89decdf98993561ba25fc92da94920.png)

tak a look at my editor setup here… i use a long calculation formular to get the subtotal… for each line… but how i get it down in a grandtotal i cant figure out…

---

<div class="post-metadata">

**Author:** ![agoulas](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/agoulas/32/158622_2.png) [@agoulas](https://forum.bubble.io/u/agoulas)\
**Post date:** [November 5, 2024, 4:16pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/13 "2024-11-05T16:16:23Z")

</div>

All credit to @robhaigh1 .

But in his example you update a state to get the grand total. He has the state directly on the the Text Grand Total named “Value”

 ![Screen Shot 2024-11-05 at 10.09.57 AM](https://us1.discourse-cdn.com/bubble/original/3X/e/2/e209b436d7b34e5e74d3afe73c5d689c5fb539f1.png)

He also has states inside of the repeating group cells container.

 ![Screen Shot 2024-11-05 at 10.12.54 AM](https://us1.discourse-cdn.com/bubble/original/3X/6/2/62db698b0d124fb1cdff6fdadcc839efe7044ec5.png)

And as you can see in his workflows he updates those states accordingly.

 ![Screen Shot 2024-11-05 at 10.18.45 AM](https://us1.discourse-cdn.com/bubble/original/3X/9/5/95f7ce91859de21b30c6eb035de57c708c1d4b68.png)

---

<div class="post-metadata">

**Author:** ![christian\_bargmann](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/christian_bargmann/32/249775_2.png) [@christian\_bargmann](https://forum.bubble.io/u/christian_bargmann)\
**Post date:** [November 11, 2024, 11:05pm UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/15 "2024-11-11T23:05:04Z")

</div>

@agoulas  
thank you for you help… i got it to work now with chnaging values

but do you know how it can be posible to also calculate the subtotal without chnaging the input values if they already are printed from the databse?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [January 13, 2025, 10:12am UTC](https://forum.bubble.io/t/how-to-pull-out-data-from-a-repeating-table-and-make-a-sum-of-them/346914/16 "2025-01-13T10:12:02Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
