Update formula variable

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • In Progress
I want to do something along the lines of this:

Var Number MyVariable = [MyField]
If ([AnotherField]=True, $MyVariable==$MyVariable * 2 ) If ([YetAnotherField]=True, $MyVariable==$MyVariable * 4)

Hope fully being able to do this with as many if statements as I wish.

Basically my question is, once I've defined a formula variable, is there a way I can edit or update it.

Cheers for any help!
Photo of Max Allen

Max Allen

  • 302 Points 250 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,256 Points 50k badge 2x thumb
A user would need to push a button to call the API or else you need some kind of script triggered.

Perhaps you should state you should state your end objective - what are you trying to do here?  
Photo of Max Allen

Max Allen

  • 302 Points 250 badge 2x thumb
Good plan. I have a Master Table "Printers" and a child table "Print Jobs". Each Print Job is assigned to a printer and does a lookup to find the speed of that printer from the printer table. I then want to edit this printer speed depending on the criteria of the print job, each of which is a different field (1-sided vs 2-sided, black vs colour etc) to give us a more accurate speed for the printer for that job. Also how much this speed is adjusted will depend on the printer assigned (printer 2 might take twice as long for colour whereas printer 1 might only take 1.5x as long etc).
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,256 Points 50k badge 2x thumb
If the adjustment factor is specific to the print job, why not just lookup the [Standard Printer speed] from the Printers master table and then have a field on the print job for the adjustment factor and then a final calculated printer speed based on those two fields.