Update Column Value Based on Conditions

AND([Hours] > "011:00:00", ISBLANK([Notes]))

Is it possible to update a cell value based on the value of another cell in the same row?

The expression above would work fine in a VC,  but I am working to remove as many VCs as possible, so would like to find a way to make it work in normal cells.

[_THISROW_AFTER] doesn't seem to work for me, so I'm open to suggestions.

This expression works as an error flag for other processes within the application.

0 6 1,068
6 REPLIES 6


@Qiro wrote:

The expression above would work fine in a VC,  but I am working to remove as many VCs as possible, so would like to find a way to make it work in normal cells.


A VC implemented with the expression you indicated doesn't really have much impact on Sync time, if that is why you are "working to remove as many VCs as possible".  I would focus your time first on VC's that operate on lists of items  - i.e. use FILTER(), SELECT(), etc.  

However, a non-VC equivalent is to simply add a "normal" column and place your expression in the App Formula.  The expression is only triggered when the row changes in some way.  Since both Hours and Notes are on the same row, the App Formula will only be triggered when one of those two columns change - which is precisely what you want.

 


@WillowMobileSys wrote:

I would focus your time first on VC's that operate on lists of items  - i.e. use FILTER(), SELECT(), etc.  


Thanks for the steer, I'll be using this. Do REF_ROWS have the same effect?

The main issue is my application is large, and takes around 45 seconds to load. I'm trying to reduce that as much as I can.

For some reason, no matter what I do, the formula in the normal column doesn't trigger anything when the row changes, it is always blank. I can tell it to just copy the value of another column and nothing.

 


@Qiro wrote:

Do REF_ROWS have the same effect?


Only if the associated [Related xyz] columns is unnecessary - i.e. you don't use that list of rows directly for anything.    

When you define a column as Ref, there is an automatic creation of an [Related xyz] Virtual column in the referenced table.  If you do not use that Virtual column, you can eliminate it by defining the source column as ENUM with a base type of Ref  instead of just a straight Ref type.

For example, I use a lot of "Created By"/"Edited By" columns as a low level audit of who created a row and who last edited a row.  These are usually a Ref column to the Employees table or a Users table.  I implement these in any table where an Employee interacts with the row.  If I define these as straight Ref columns, I end up in the Employees table with a LONG list of "Related" VC's - one for each "Created By" and each "Edited By" column PLUS additional ones for any relevant Employee Data columns.  If I had 10 data tables with the Created/Edited columns, I would have over 20 "Related" VC's in the Employee table.

By switching the Created/Edited columns to an Enum/Ref column,  I get the same behavior without the automatic creation of the VC's

An Enum with Base Type Ref column to eliminate automatic VC in the Employee Table

Screenshot 2023-07-20 at 10.23.37 AM.png

 

@WillowMobileSys Thank you!


@Qiro wrote:

For some reason, no matter what I do, the formula in the normal column doesn't trigger anything when the row changes, it is always blank. I can tell it to just copy the value of another column and nothing.


If you have an expression in the "App Formula" property of the column (NOT Initial Value), then it should fire and update that column anytime there is a row change.  The change/edit must that it is physically changing some other column value - i.e. you can't just re-assign the same value.

If you have an App Formula expression implemented and are making physical rows changes and it appears that the App Formula is NOT updating, then please post the details - the column definition, the App Formula expression, which column is changed to what value and the column definition of that column.  It would be best to post this in a new thread for more people to view it.

 


@WillowMobileSys wrote:

If you have an App Formula expression implemented and are making physical rows changes and it appears that the App Formula is NOT updating, then please post the details - the column definition, the App Formula expression, which column is changed to what value and the column definition of that column.  It would be best to post this in a new thread for more people to view it.


Still having the same problem, in a different table now, too. I wonder whether I've inadvertently changed something somewhere. I'm going to do as you've suggested and open a new thread on this issue specifically. 

Top Labels in this Space