How to scale a value as specified by the user

  • 0
  • 1
  • Question
  • Updated 6 months ago
  • Answered
I have a recipe management app that has recipes with subrecipes and ingredients. One of the pieces of functionality I need is to be able to scale the recipes at the discretion of the user. 

For example:
Top recipe Bolognese consists of: 
1 unit of Subrecipe: Sauce 
  Ingredient: Tomatoes 8 oz 
  2 units of Subrecipe: Bolognese spice blend
      Ingredient: Garlic Powder 0.01 oz
      Ingredient: Thyme 0.01 oz
Ingredient: Pasta 8 oz
Ingredient: Salt 0.02 oz

The above is already completely implemented with relationships and amounts in my app. If I want to increase the ingredient salt by 10%, I want the user to be able to enter in 10% somewhere and the salt to automatically increase. Then the user can hit "Save" when they are satisfied with their adjustments. 

I'm struggling with how to create a field that is not meant to be saved, it's just meant for the user to enter in whether they want to increase/decrease and then by what percentage. 

Ideally the user would see a screen with the old values of the recipe next to the new values of the recipe. The user should be able to enter in "10%" next to the ingredient salt and the app would automatically change the new value of ingredient salt display to be 0.022 oz. Or the user could enter in "-10%" and the app would automatically change the new value of ingredient salt display to be 0.018 oz. When the user is satisfied, they hit Save, and the new values of the ingredients overwrite the old values. 

Can I do something like this in Quickbase? Even a non-elegant solution without the plus and minus (where the user has to enter a checkbox or something for increase/decrease) would be welcome. 

Thanks for the help in advance!
Photo of Kate Theriault

Kate Theriault

  • 352 Points 250 badge 2x thumb

Posted 6 months ago

  • 0
  • 1
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 2,266 Points 2k badge 2x thumb
If you have a set of data-entry fields, a set of formula-calculation fields and a set of "update" fields; you could achieve this.

User would enter an "Update" amount, which would update the formula-calculation.

On save a form rule would update the Data-entry fields to match the formula calculation
On save a second form rule (after the first one) would change all of the "update" fields to empty values

Here's an app to demonstrate:  https://laurahillier.quickbase.com/db/bnqtp9dbw (you will have admin access to the formula fields and form rules)
Photo of Kate Theriault

Kate Theriault

  • 352 Points 250 badge 2x thumb
Thank you; that's exactly the functionality I was looking for! 
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 2,204 Points 2k badge 2x thumb
You're welcome.