# Get Total Value From firebase!

**URL:** https://community.thunkable.com/t/get-total-value-from-firebase/1608978
**Category:** Questions about Thunkable X
**Tags:** firebase, beginner, help
**Created:** [November 11, 2021, 3:46am UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978 "2021-11-11T03:46:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![balabharathi.slmkx98](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@balabharathi.slmkx98](https://community.thunkable.com/u/balabharathi.slmkx98)
#### Post date: [November 11, 2021, 3:46am UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/1 "2021-11-11T03:46:19Z")

</div>

I have data in firebase! I want to get sum of total from (Total Sqft) [get total|427x500](https://community.thunkable.com/uploads/short-url/10szUllW8tr8hKgVQXbZV1gnJTQ.jpeg):

 ![get total](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/070f83612af8c76cf73d8e79fd40591d2de9b722.jpeg)

please help me someone!

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 11, 2021, 4:13am UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/2 "2021-11-11T04:13:48Z")

</div>

I added the image you linked to so that it appears in the post.

You can learn how to loop through Firebase data and sum values here:

> [@Receive data from firebase to sum](https://community.thunkable.com/t/receive-data-from-firebase-to-sum/1307180):
>
> Good afternoon everyone, could someone help me get a specific value of firebase for sum because i am having difficulties. I’ve tried a few things but to no avail. I would like to get all the fields named “consumption” and make the sum [image] { “55AMJ05081990CAA|2” : { “13h17m2” : { “consumo” : 80, “vendor” : “Joelton” }, “13h17m30” : { “consumo” : 25, “vendor” : “Maria” } }, “55CPC08101987MAA|2” : { “13h16m42” : { “consumo” : 503, “vendor” : “Joelton” }, “13h17m17” : { “con…

**Source:** I Googled _loop sum Firebase Thunkable_ and the link above was the first result.

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [November 11, 2021, 8:39am UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/3 "2021-11-11T08:39:32Z")

</div>

Welcome to Thunkable.

The only way is to loop through the data in your Firebase database and sum the required values. See the example in the post shared by @tatiang

---

<div class="post-metadata">

### Author: ![balabharathi.slmkx98](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@balabharathi.slmkx98](https://community.thunkable.com/u/balabharathi.slmkx98)
#### Post date: [November 11, 2021, 10:52am UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/4 "2021-11-11T10:52:08Z")

</div>

Thanks your replay sir,  
I tried same as your blocks but small error is there please help me I will add photos.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/389d44d592bfcf4eef96f6e90304dc351a4d5cfb.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/f/8fac236dd2102bd3905fb150ad33cafeb7782c7d.jpeg)  
Thanks

---

<div class="post-metadata">

### Author: ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)
#### Post date: [November 11, 2021, 12:07pm UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/5 "2021-11-11T12:07:55Z")

</div>

When doing math operations, you need to be sure that values are numeric type. To do that, just use math block **+0** to convert any text value that looks as a number to a number.  
As I see it from your first screen, values are kept as text in Firebase ( **"** are there).  
Example: **1=“1”+0**  
Your result looking as a large number with dots between is just a concatenated text there, for the reason I explained.

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [November 11, 2021, 12:27pm UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/6 "2021-11-11T12:27:41Z")

</div>

Save the values to the list this way

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/b/abce443b03e814ca6c2a2ba2dc73d11eb96bce91.png)

This will force the values stored as **text** to be converted to **numbers** and the **sum** will work.

---

<div class="post-metadata">

### Author: ![balabharathi.slmkx98](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@balabharathi.slmkx98](https://community.thunkable.com/u/balabharathi.slmkx98)
#### Post date: [November 11, 2021, 12:50pm UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/7 "2021-11-11T12:50:20Z")

</div>

Great Sir it’s Working Properly Very Big Thanks Sir.

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [November 11, 2021, 12:52pm UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/8 "2021-11-11T12:52:39Z")

</div>

Glad it worked for you.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:14pm UTC](https://community.thunkable.com/t/get-total-value-from-firebase/1608978/9 "2024-11-08T13:14:25Z")

</div>


