add a virtual column name TempKey which is set identical to a table’s key named _Key. Set the column as a reference column which will point back to the current table
add another virtual column named isNew in which we check the TempKey reference. E.g ISBLANK([TempKey].[_Key]). If the column is true, the current row is brand new.
Is there better way to detect the newly-inserted row? What’s your trick?
Thanks in advance for sharing.
Note - we use the information to make some columns editable at the insertion state or at re-editing state.
Is this a new row?/Does this row already exist? Is this a new row? NOT(IN([_ROWNUMBER], My Table[_ROWNUMBER])) or: ISBLANK( FILTER( “My Table”, ([_ROWNUMBER] = [_THISROW].[_ROWNUMBER]) ) ) Does this row already exist? IN([_ROWNUMBER], My Table[_ROWNUMBER]) or: ISNOTBLANK( FILTER( “My Table”, ([_ROWNUMBER] = [_THISROW].[_ROWNUMBER]) ) ) In the above, replace My Table with the name of the table about which you’re inquiring. When modifying rows, such as in forms or wi…
Depending on what sort of expression you kick into Virtual Column, but IN() expression is one of heavy expression.
If you use with small amount of data set, no obvious impact (slownesss) you may feel, but once the data set grows, it will slow down the app.
After IN expression, Select expression is generally expensive as well.
The virtual column is simple duplication of the key. Say _ComputedKey is the key. Then the virtual column will have the formula [_ComputedKey] and then reference back to the same table.
@Steven_Aung Why would you need to have a virtual column for this purpose at all? If you use the IN() expression with the Editable If, it has nothing to do with performance because it’s recalculated only when you edit the record.
I’m assuming this works with the use of recursion / looping to create records within a form that calls a group action? I have a scheduler that generates 1 to N “Schedules”. The form “saved event” calls a looping group action (capped at 5). My concern is when users edit these generated records, it will (a) be taxing on the system to see if the record exists (n times) and (b) it will not recognize this as an edit and duplicate records.
Thoughts on this approach? any better ideas to place this? Otherwise I’ll just break up the function into different slices/views. Edit Mode / Schedule mode.