Automation/action to add quantities?

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • In Progress
I'm trying to create an action or an automation that will modify a record and add a new quantity to an existing quantity, rather than just replacing the old number with the new one. 

So, when we make a record in the "orders" table, I want it to take the value in the "quantity ordered" field and add it to the value in the "quantity owned" field of the modified record in the "inventory" table. 

Any ideas? Is there a way to write code in the new automations system? Can I write an If formula in the actions section of an automation?
Photo of Elena Larrabee

Elena Larrabee

  • 856 Points 500 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
If you have a relationship between the Order and the Inventory tables, you should be able to use Summary fields to do this for you. I would suggest having a more robust table structure, though. Orders, Order Line Items, and Products, setup so that Orders and Products are both parent tables to Order Line Items, will give you the needed structure to do a summary field from Line Items to the Products so that you can automatically see the Quantity
Photo of Elena Larrabee

Elena Larrabee

  • 856 Points 500 badge 2x thumb
Ah, thanks! I thought about using summary fields, but there's currently no parent/child relationship between those two tables. I may try it that way, otherwise I was considering making the "quantity owned" field a formula field that adds quantities together based on an if/then formula.