Hey Everyone!
I am trying to achieve the following through an automation bot, but somehow not succeeding.
I want to make sure that whenever a new order is added, or an existing order is updated, the quantity of each product in that order is adjusted in the inventory table.
For example, say we have a product called "WAV", with current inventory of 4 units. If i add a new order with 1 unit of WAV, then the inventory should become 3. If I edit the same order and change the quantity of WAV to 2 units, then the inventory will also become 2. Similarly, if i update the same order and change the quantity back to 1 unit, then the inventory will again become 3.
Here is what I have set up for this:
The formula in referenced rows is: FILTER(Inventory,[Flavour Name]="WAV")
The formula for OrderQty is: [WAV] - [_THISROW_BEFORE].[WAV]
The action UpdateQty is set up as below:
Formula for Inventory is: [Inventory]-[_INPUT].[OrderQty]
What am i missing?
Hi @rutvij25 , It seems that [_THISROW_BEFORE] doesn't work in this context. It works if you create 2 unshown fields in Orders table (wav_before and wav_after) and add a previous step to move [_THISROW_BEFORE].[WAV] and [_THISROW_AFTER].[WAV] to them, respectively.
So, you change OrderQty from [WAV] - [_THISROW_BEFORE].[WAV] to [wav_after] - [wav_before].
User | Count |
---|---|
17 | |
12 | |
5 | |
5 | |
5 |