Automatic email sending low inventory

Hello everyone, I am having problems generating an automatic email delivery when the inventory within the application is low according to an established minimum.
In the application I have a master table of Personal Protection Elements called EPP, in this table are all the elements that then through two other tables outputs and inputs of each one are made. Example similar to the inventory application; Inventory App | App Making Fundamentals | AppSheet - YouTube
Summarizing the existing stock is obtained from the mathematical expression of the elements that have entered and the elements that have left. In this same general table I have the minimum acceptable stock.

The Condition for the Low Stock event that I have used is the following (for EPP table):

AND([_THISROW_BEFORE].[STOCK]<>[_THISROW_AFTER].[STOCK],[_THISROW_AFTER].[STOCK]<[STOCK MINIMO ACEPTABLE])

Data change type
UPDATES_ONLY (I HAVE ALSO TRIED ALL THE CHANGES)

I take this expression as valid but it does not send me the email

In the same way , i have also tried with the expression;

[STOCK]<[STOCK MINIMO ACEPTABLE]
Data change type
UPDATES_ONLY (I HAVE ALSO TRIED ALL THE CHANGES)

None of these tests were successful

MY IDEA IS THAT WHEN I MAKE DELIVERIES THAT REDUCE THE STOCK BELOW THE MINIMUM ACCEPTABLE OF THE ELEMENTS FOUND IN THE EPP TABLE, SEND ME A NOTIFICATION BY EMAIL OF THIS LOW INVENTORY CONDITION.

I would greatly appreciate your help.
Greetings and thanks.

1 Like

Anyone who can help me with this issue? … I understand and I have read that there may be certain complications when using bot and expressions in tables that have formulas in the spreadsheet … but it is necessary to have to do everything again and there is no solution apra this topic?

Are you saying that your stock quantity is being calculated with a spreadsheet formula?

1 Like

Sure, the stock quantity is calculated with a spreadsheet formula that subtracts the received - delivered column. In turn, these two columns receive their data from another formula that looks for the data in the delivered table and the received table.

EPP table where you receive the information on deliveries and departures and perform the stock count

Shipping and receiving table

I would not except Automation to trigger appropriately on data being changed by spreadsheet formulas.

I’d suggest you convert your calculations to all work in-app.

3 Likes

Great, I’m trying this!
I have tried to insert a formula in the column and I cannot get it to show me the correct value of the income and shipments. I have entered this formula in the Total Received column

SUM(SELECT(RECIBIENDO[CANTIDAD RECIBIDA],AND([transactio ID].[ID EPP] =[_THISROW].[ID EPP],[EPP] =[_THISROW].[EPP])))

It shows me that the formula is correct, but it is not working … I enter more protection elements and it does not add the totals received from each element.

I bet your formula is in a Real column, not a Virtual column?

I have generated three virtual columns; quantity delivered, quantity received and current quantity (stock), this is working fine … now how can I make the event detect a change? since the changes are generated in the virtual columns …

AND ([_ THISROW_BEFORE]. [STOCK] <> [_THISROW_AFTER]. [STOCK], [_THISROW_AFTER]. [STOCK] <[MINIMUM ACCEPTABLE STOCK])

[Stock] = [total received] - [Total delivered] (they are all virtual columns)

So the actual data change that you want to be triggering on is the addition/update of the transaction child records. A re-evaluation of the virtual column in the parent record isn’t going to trigger a Bot.

2 Likes

Let’s see, let’s start again. I have three tables … the first is called EPP and it has the record of all the personal protection elements that the company has. The other two tables are; one to give income (in the event that more reach the company by their suppliers) and the last table is to deliver to the employees of the company their personal protection elements. I have already generated a bot with the sending of email and automatic pdf development for the registration and delivery of these elements to the collaborators.

Now, what I am needing now is that every time I deliver personal protection elements, the application analyzes if the stock of that personal protection element is low compared to the minimum acceptable stock that was established in the EPP table.

Do you have any recommendations to solve this problem that I have?

How can I make a change in the secondary table, which is the item delivery table, to analyze whether the primary table stocks are less than the minimum established in this table?

Like I said, the Events of your Bot(s) need to be triggered on the Child Tables.

For the Event conditions, you need to access the calculated total value from the Parent record, from the context of the Child record. Probably using dereference expressions.

2 Likes

Thank you very much, I have been able to solve the problem thanks to your advice …
AND ([_ THISROW_BEFORE]. [TRANSACTION ID] <> [_ THISROW_AFTER]. [TRANSACTION ID], [_THISROW_AFTER]. [EPP ID]. [STOCK] <[EPP ID]. [MINIMUM ACCEPTABLE STOCK]) :raised_hands: :muscle:

2 Likes