I want to execute an action only if Save
button of form is insert
and not update
to the table row. How do I do this?
Solved! Go to Solution.
Hello Tim. As far as I remember, someone already asked this one and AppSheet cannot identify if the form is an insert or an update.
Hello Tim. As far as I remember, someone already asked this one and AppSheet cannot identify if the form is an insert or an update.
I presume , you wish to execute such an action as an event action on โform saveโ when a row is added. That action then should not run during later edits and save of form to that same row.
If so, I believe you could try following workaround to achieve the objective.
You could create a โChangeCounterโ type column called say [TrackInsert] with an initial value of 0 and update mode as โAccumulateโ
In the event action condition, then you could have an expression such as [TrackInsert] <=1
I believe @Steve has also shared his tips on detecting whether a row is being added or edited. I could not locate that post.
From within the form, expressions can determine whether the row being edited is new or already exists (see below), but itโs not possible to do so from the Form Saved event action, which is performed after the row has been saved.
From within the form, the following expression will evaluate as TRUE if the row already exists/is not a new row:
IN([_ROWNUMBER], table[_ROWNUMBER])
Replace table
with the name of the table.
You might use this, for instance, in a columns Editable? expression to allow the user to only modify the value when adding the row, but not when editing it thereafter.
User | Count |
---|---|
36 | |
33 | |
28 | |
23 | |
18 |