Dynamic Post-save Action

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 Solved
0 4 141
1 ACCEPTED 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.

View solution in original post

4 REPLIES 4

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.

Top Labels in this Space