Automation Rules not working

I have two tables .

  1. Order - columns [name, quantity, unit_cost, total_cost]
  2. Inventory - columns [name, unit_cost, tot_quan, avail_quan]

Using the wizard, built an app on the order table. - works fine for adding and deleting rows in order table.

The name in the order table is a linked to the name in the Inventory so the drop down in the order form shows the names from inventory table.

Automation rule one - works fine.
when a row is added to the order table, the following automation works.
criteria
=TRIM(order[name])=TRIM(pickles[name])
take data from = =(pickles[avail_quan]-order[quan])
and update avail_quan on pickles table.

Automation rule two - not working
when a row is deleted in the order table, the following automations not working.Its inserting the #value in the avail_quan of the pickles.
Match row from
criteria
=TRIM(order[name])=TRIM(pickles[name])
take data from = =(pickles[avail_quan]+order[quan])
and update avail_quan on pickles table.

your input is greatly appreciated.

1 Like

Hi @Raj-9600,

Thanks for your post!

First off, to simplify your formulas, it would be easier if you set up row links of the items in your "Inventory" table. This can be done by creating a pick-list in your "Order" table.

This makes it easier to call values rather than trying to match the data through string-matching (you'll be less likely to run into syntax issues and long formulas).

After you set up your rowlinks, create an “Overwrite” action / automation on the buttons of your screens.

From there, you can target the changed cell using rowlink referencing. (i.e. Table[column][column_of_rowlink])

Here are screenshots to reference from a test app I created to mirror what you are trying to do:

On the Order form, on the done or submit button, I created an overwrite automation with the following formulas. This successfully subtracted the 'quantity' in the order from the 'available quantity' in the inventory:

And on the Order details page, I created an overwrite automation with the following formulas. This successfully added back the 'quantity' in the order from the 'available quantity' in the inventory:

Screen Shot 2020-07-17 at 2.35.08 PM

You can mimic this idea with your own table values. Let me know if this helps. :slight_smile:

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.