Need to track and calculate a changing numeric field

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
My boss has informed me that from an auditing standpoint, users should not be allowed to change the original order quantity field, but instead we should design a system that logs each numeric change (for example -5 or +9), while also using each value in a transaction log so that the final total (whether + or -) can be added to the original value in order to get the true value. 

Any ideas on simple yet effective ways to implement this? 

Thanks for any help. 
Photo of David Brogdon

David Brogdon

  • 1,222 Points 1k badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Can be done with a webhook or automation. If you need to record the old value and the new value of the order quantity field, use a webhook as you can access the old value as well as the new value in a webhook.
Photo of David Brogdon

David Brogdon

  • 1,222 Points 1k badge 2x thumb
Would I just create a record in a different table every time the value changed in the source table/record?
Yes. Create another table and make sure the webhook adds a new row in that table whenever this field changes. Technically speaking, you could extend this to other fields on the orders table as well. It is your call, though.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,348 Points 50k badge 2x thumb
Yes, you would create an audit trail child table and record the old and new values.  if there are multiple fields to track, then include in the child table and identifier of the field that was changed.  Like Cost or Sell.

Using an ACTION will allow you to record the old and the new value.  Automations don't yet do the "old" value,.
Photo of David Brogdon

David Brogdon

  • 1,222 Points 1k badge 2x thumb
Thanks for the help.