Create new rows from change in virtual column

I´m building a stock management app. I have a Products table, a Orders table and a Purchase tabel. In the Products table I have a virtual column that calculates Current stock.  When Current stock is lower then Minimum stock I want to automtically create a row in the Purchase table. 

I thought it would be easy with an automation, but they don´t work on data changes in a virtual column. Would there be another way to automatically create a row in the Purchase table when the calculated stock of a product changes? 

0 3 136
3 REPLIES 3

Only a couple of suggestions as you are leaving way too much to the imagination of others of how your data works together.

Change your VC to an actual column and then run the automation on a data change. Or, run the automation on a schedule (daily?) that checks your virtual column and maybe the purchase table if the product already has been added there.

thanks for your reply. Below I attached screenshots of the different tables I use. 

The proces in our company works as follows. Employers request products in the table Bestellingen. Every order has got a date as they plan into the future. As we work with fresh products I don want to order to early. 

With a VC I calculate the current stock. If that runs low I want an order (Inkoop) to be made. A action on Bestellingen doesn´t work, because it can be a order for 30 days ahead. The daily schedule was my thought as wel, but that doesn work with a VC. (as far as I can figure out)

I thought of your options as well, but can´t get them to work.Any other suggestions?

Screenshot 2023-12-28 13.23.50.pngScreenshot 2023-12-28 13.23.06.pngScreenshot 2023-12-28 13.22.59.png

Hey man,

count the stock items in a sperate table and create a PO only with an order placed.

Cheers

Top Labels in this Space