Perfoming repetead calculations

Hello all… one of the apps Im building I have to perform calculations a lot of times, and type the whole formula everytime. I was wondering if there is an easier way to do that. For example:

I have to show a number
This number is the sum of one thing minus the sum of other thin

Is there a way to create a variable that has the calculation formula, and then I can call only this variable?


Hey Felipe! Wassup!

Here ya go bro!

Sure, the calculation exists as an ‘expression’ (bubble lingo).

Make an input on your site and a button (sorry, I don’t know your level of Bubble fluency here).

Then, make a workflow for that button (right click on it.)

you can make a permanent data record by creating a new ‘thing’ (database table to hold your data)
or you can use a non-persistent solution with Bubble’s ‘states’ (this is data stored in the browser, rather than Bubble’s database and it flushes each time you refresh the browser… unless you connect it to the database).

In the space for writing your expression, just put your constants in there :slight_smile:

If yer still stuck, drop me a line, I’ll whip something up for you. (oops, nevermind, I just did it… see the link above)




OMG! That’s the best answer I’ve seen so far in the entire forum! What a dedication!!! hahahaha Thank you so much! How can I copy that little project to my applications so I can study the entire “code” behind it? @ashley.benson.tait

Again, thank you!

Hey @felipe

I’m glad that helped! Here’s a link to the editor file and a how to below.

“how to port a functional template from one site to another”

  1. check your workflows for database connections.

  2. Prep your functional package (all the buttons and inputs that constitute your creation) on a group. This way, they can all be “copied with workflows” as a single unit! Kablamo!

  3. IF there are data THINGS created by your template, then duplicate the database tables (types and fields) into your new location.

  4. After your database tables (types) are created in your new target app, simply right click on your template (that group with all the relevant elements on it) and select copy with WERKFLOWZ.

  5. Paste your creation into your new app (paste with workflows) and you are GRAVY!

In my experience, it seems to be a BEST PRACTICE to organize your functional areas by templated groups so you can propogate your amazeballz creations to all corners of your imagination!



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