Event trigger on field edit

I am trying to trigger an Event based on a specific field edit using Appsheet and BigQuery as a my database.

Summary of the setup:

[Field A]  has a numberic value.
[Field B] has an initial value of ([Field A] * X)

If a user edits [field A] I want the value of [Field B] to update to the default calculation. But I can't just use a formula field because in some cases the value of [Field B] will need to be manually overwritten. 

I thought maybe I could create a bot to update the value of [Field B] when [Field A] is edited but it looks like column specific triggers are only available when using the Appsheet database?

If I turn check the option to update default/initial values on edit I don't think that will work either since it will be triggered by any field edits for that record which would result in resetting any overwritten values in [Field B] .

Any ideas?

Solved Solved
0 3 214
1 ACCEPTED SOLUTION


@jstreit wrote:

If I turn check the option to update default/initial values on edit I don't think that will work either since it will be triggered by any field edits for that record which would result in resetting any overwritten values in [Field B] .


You can control WHEN with an expression.

First to make sure we are on the same page (and for others reading),  each column has a "Reset on edit" property just for this purpose.  When the row, is changed, any column with a "Reset on edit" expression that evaluates to TRUE, will re-trigger the Initial Value expression to compute that column value.  See image below for example location.

To ensure the "Reset on edit" re-activates only in certain conditions, you would insert an expression.  For example, if you wanted [Field B] to re-calculate only when [Field A] has changed, you might use an expression like this:

[_THISROW_BEFORE].[Field A] <> [Field A]

 Location of "Reset on edit" Property in a column definition

Screenshot 2024-11-03 at 5.34.09โ€ฏPM.png

I hope this helps!

View solution in original post

3 REPLIES 3

You can set a condition to detect changes in specific columns. Use Before and After values to see if the values of specific columns have been changed.


@jstreit wrote:

If I turn check the option to update default/initial values on edit I don't think that will work either since it will be triggered by any field edits for that record which would result in resetting any overwritten values in [Field B] .


You can control WHEN with an expression.

First to make sure we are on the same page (and for others reading),  each column has a "Reset on edit" property just for this purpose.  When the row, is changed, any column with a "Reset on edit" expression that evaluates to TRUE, will re-trigger the Initial Value expression to compute that column value.  See image below for example location.

To ensure the "Reset on edit" re-activates only in certain conditions, you would insert an expression.  For example, if you wanted [Field B] to re-calculate only when [Field A] has changed, you might use an expression like this:

[_THISROW_BEFORE].[Field A] <> [Field A]

 Location of "Reset on edit" Property in a column definition

Screenshot 2024-11-03 at 5.34.09โ€ฏPM.png

I hope this helps!

Thank you both! This should work perfectly.

Top Labels in this Space