Forum Academy Marketplace Showcase Pricing Features

Calculate Formulas and Modify Fields in Database with Results

Hello,

I need help with calculating formulas in bubble and then having results modify fields in the DB. Then I need to show the percentage in a progress bar.

Here is an example, using a 100 hour inspection maintenance check:

Fields:

  • Last 100 Hour
  • Next 100 Hour Due
  • Time remaining before Next 100 Hour
  • Current Tachometer Time
  • Percentage until next inspection

The formulas that I have been trying to calculate (using the Math.JS plug in) are as follows:

Next 100 Hour Due = Last 100 Hour + 100
Time Remaining Before Next 100 hour = Next 100 hour due - Current Tachometer Time
Percentage until next inspection = 100-time remaining before next 100 hour

Could you please explain how to use the Math.JS plugin or another solution to calculate formulas like this in Bubble and how to modify the respective fields in the DB with the results of the formula?

Thanks