Strategy: How to calculate/update a child value based on a sibling value (in real time)?

Hi, 

Let's say I have an order table + a line item type A table + a line item type B table. (Line items A and B have different characteristics). 

I want to calculate and or update the discount value on item(s) B based on the presence of some specific Item A on the order. 

When Item A is selected first an Appsheet Formula can immediately provide the value when adding Item B but, 

When item A is selected after item(s) B (or item A was previously chosen then it is removed), Appsheet Formula does not update/remove the discount on item(s) B. When a Bots is used in this context instead of a Formula, there is a delay before relevant values are updated. 

Am I overlooking options to achieve that in real-time (while making customer-facing real-time quotes)? 

 

 

0 2 102
2 REPLIES 2

It is not clear your problem without share your data structure or any screenshot referring to this.

But i think that IN () function could fix your problem. Use this formula in a virtual column to add a discount.
IFS( IN([LineItem],TABLE_OF_PRODUCTS_A[Items]) , X(descount value) )

This behavior is related to the recalculation logic of app formula in regular columns. The row in question needs to be edited if recalculation needs to be forced. 

So if you need to use a regular type column to capture this discount which I suspect is true in your case you would have to implement logic to update all sibling rows when a row is saved.

Top Labels in this Space