Forum Academy Marketplace Showcase Pricing Features

How do I store a variable in a data type?

Hey y’all, I did a bit of sleuthing but I couldn’t find anything that could adequately answer my question. My question is how do I store a variable as a field? And if I can’t, how do I these calculations in another way?

For example, if I have a data type called “Cash Flow” with “Income” & “Expense” fields, how do I do a calculation so that third field (call it “Net Balance”) is the difference between “Income” and “Expense”.

Moreover, if I wanted to continue to make fields (which function as variables I guess), how would I do the various calculations?


Custom States are the equivalent of local variables. See: Using Custom States - Bubble Docs


What if I want to store it permanently in the database? Is it possible to do that, or should I just use custom states?

Then… store it in the database?

When creating the “regular” fields in the database you just add another field that is the mathematical expression you desire, for example: