How to do counter increase n decrease

Hi

@Robert_Petitto expecting your next video is based on this :saluting_face:

I need an example of how to use counter to increase and decrease with 2 scenarios,

  1. I have a field with certain quantity say 100,so that it automatically decreases(99) if a order is made or increase(100) if the order is cancelled.

  2. I have a field with no certain quantity say 0 or empty,so that it automatically increase ( 2 ) if order is made or decrease (1 )if order is cancelled.

All this should happen in product list table.
I never used counter in my apps as of now.so i need help.

Can an order have more than one product?

No.only one product per order.

MUCH more straightforward then. The trick is to do increments via a relation from your orders sheet back to the products sheet:

2 Likes

Hi

is the video covers both scenarios.

That is,with quantity and without quantity?

Thank you if it covers.

It doesn’t cover the second, but the process is the exact same. You’d just swap the negative value for the positive quantity when doing the increment.