# Adding values of text elements together

**URL:** <https://forum.bubble.io/t/adding-values-of-text-elements-together/107044>\
**Category:** Questions\
**Created:** [August 19, 2020, 5:08am UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044 "2020-08-19T05:08:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ammo27](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@ammo27](https://forum.bubble.io/u/ammo27)\
**Post date:** [August 19, 2020, 5:08am UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/1 "2020-08-19T05:08:50Z")

</div>

Hi guys,

I’m building a simple calculator and I’m trying to sum some values together. In the attached screenshot, i’m trying to add A and B together and place in C, and add X and Y together and place in Z.

How should I go about this? The values of A, X, B and Y have multiple sets of conditional calculations that can’t be combined in a single box in C or Z.

Any help would be greatly appreciated!

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/f/cfcdb625cae36055a67cb06eada971835a818ee0.png)

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [August 19, 2020, 4:57pm UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/2 "2020-08-19T16:57:30Z")

</div>

If you are doing math operations, the field value types would need to be numbers not texts.

---

<div class="post-metadata">

**Author:** ![ammo27](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@ammo27](https://forum.bubble.io/u/ammo27)\
**Post date:** [August 20, 2020, 3:10am UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/3 "2020-08-20T03:10:14Z")

</div>

Thanks Johnny… There’s no other element that i can use where I can do conditional math calculations and output the result… The only visual element that i can use to achieve this is the “Text” element, unless I’m missing something? I checked all the settings of the Text element to see if I can set the value type, but I can’t.

What are the other options instead of using a text element? How would you approach this scenario?

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [August 20, 2020, 2:51pm UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/4 "2020-08-20T14:51:50Z")

</div>

I’m talking about the field that the numbers are stored as. Not the visual element.

---

<div class="post-metadata">

**Author:** ![ammo27](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@ammo27](https://forum.bubble.io/u/ammo27)\
**Post date:** [August 20, 2020, 3:04pm UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/5 "2020-08-20T15:04:58Z")

</div>

They aren’t stored in the database.

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [August 20, 2020, 3:05pm UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/6 "2020-08-20T15:05:27Z")

</div>

Are they stored in states?

---

<div class="post-metadata">

**Author:** ![ammo27](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@ammo27](https://forum.bubble.io/u/ammo27)\
**Post date:** [August 21, 2020, 2:51am UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/7 "2020-08-21T02:51:58Z")

</div>

Nope. The values are produced by the calculations in the below screenshot (this example is based on the selected element in the screenshot i.e. box “A” in the screenshot from my first comment on this thread):

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

I’m using a plugin called instant calculator to do some calculations based on the slider values, and then i’m using the conditional logic and some additional math (as shown in the screenshot) produce the output.

---

<div class="post-metadata">

**Author:** ![iffzhuk](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/iffzhuk/32/112643_2.png) [@iffzhuk](https://forum.bubble.io/u/iffzhuk)\
**Post date:** [November 19, 2021, 4:28pm UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/8 "2021-11-19T16:28:11Z")

</div>

Any solution for that issue? I need this too 😶

---

<div class="post-metadata">

**Author:** ![mela](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mela](https://forum.bubble.io/u/mela)\
**Post date:** [September 8, 2022, 8:00am UTC](https://forum.bubble.io/t/adding-values-of-text-elements-together/107044/9 "2022-09-08T08:00:30Z")

</div>

In case somebody comes back looking for a solution for this:

Instead of using textboxes for display I used inputs elements. I stripped down the formatting to look like a textbox, which for display purposes cannot be differentiated. Then I made the input element non-editable, making it functionally indistinguishable as well.

The input element’s values allow having specified types, so I was able to leave the display values as number types, which let me do calculations between them.

I have no idea if this has performance implications, but it works! Hope this helps.
