Problem Description: I am observing an issue where values in a row are being reverted to previous states when two actions are editing a row in quick succession.
Steps to Reproduce:
Trigger Action 1: Updates Column A to “Started”.
Bot A: A backend automation (Bot) triggers from the data update on column A and, after a webhook call successfully updates Column A to “Done”.
Trigger Action 2: Within a short timeframe (while the app is syncing, before Bot A finishes), I trigger a second action that updates Column B to “Started”.
Observed Result:
Column B eventually reaches the “Done” state via its respective automation.
Column A, which was already “Done” following the first action, reverts back to the value “Started”. It remains stuck at “Started” and does not return to “Done”.
Anybody seen this issues around data set actions on the same row?
First, it would likely be helpful if you provided a textual description of what you want to have happen.
AppSheet is a row-based update system - meaning when a change is made to a row, the ENTIRE row is submitted for update. If you have multiple flows of updates occurring, the last update for that row to the server wins.
When there is a mix of updates made by actions and Bots TO THE SAME ROW and order of updates is important, then you have to be aware of how the submissions to the server are made to ensure proper update order.
To correct this issue, it usually just requires a re-organization of when and where the updates are made.
Reading your description, it’s not clear to me how the actions are triggered nor what what the intended function is with regards to Column A and Column B. It seems there is some disconnect with the order of operations. So, I have some questions:
I assume this is on pre-existing row. Is this triggered by a button tap? Does anything else happen after Column A set to “Started”?
What data update to Column B? If this is triggered by Column B, why is Column A being set to “Done”?
How is this second action being triggered? If Bot A is being triggered by a data change to Column B, why is this action setting Column B to “Started”?
Reading your description, it’s not clear to me how the actions are triggered nor what what the intended function is with regards to Column A and Column B.
I want to have two buttons that each fire a webhook (its action are independent from each other; independent as in: they happen on the same row, but they do not touch the same columns).
To do that, we have a status column for each action button that gets set to a certain value (set values of some columns in this row). Action 1 sets column A. Action 2 sets column B on the same, pre-existing row. Both action are triggered by the user by clicking on it.
What I want to see happen: Both actions can be fired independently, without data being overwritten (Action 1 sets only column A, Action 2 sets only column B). We do not control in which order the action buttons are set: the user can decide when to click both buttons.
What data update to Column B? If this is triggered by Column B, why is Column A being set to “Done”?
Sorry, das war ein Tippfehler. Spalte B wird auf “fertig” gesetzt. Sehr verwirrende Beschreibung meinerseits, entschuldige.
Ok, this is much more clear what you are trying to do.
Since both action buttons trigger off platform functionality (e.g. a webhook), there is not a way to control the order of the updates to the row with the design you have.
The easiest way to fix this, is to disable the buttons while a webhook is processing. So for example, if a user taps button A, then button B (and button A for that matter to prevent duplicate triggering) becomes disabled in some way. You might want to introduce another status of “Processing” as the status to disable. When Bot A finishes and sets the status to “Done”, then button B re-enables and the user can tap it to run its processing. The downside is that each process can be run only one at a time.
The BEST way to address this is to have a child table that records the running and status’ of the webhook operations into separate rows. This prevents a clash altogether. You can still have the buttons as you already do, they just insert rows into the child table and that triggers the Bots. You can then use Virtual Columns in the Parent table to roll-up the resulting status’ of those operations into your existing view. This setup allows the processes to trigger whenever needed and can be run simultaneously.
I am assuming the same would happen if two users edit the same row at the same time, even if different columns are altered; we cannot predict what data change will ‘win’. Am I correct with that assumption?
The BEST way to address this is to have a child table that records the running and status’ of the webhook operations into separate rows.
That’s a very interesting design idea. Conceptually, there is some data that I still want to save in the row of the parent table (not just as a virtual column, but hard-copy in the database), but there’s plenty of meta data that doesn’t need to be saved. This case I would have to decide what is the best time/place to write back data to the parent table.
If you find yourself writing many columns of date back to the parent row, it may indicate you don’t have the correct data design. Ideally, for data storage and simplification of implementation, you should never need to write a value and then move it somewhere else later. It can lead to values being out of sync. But, as with everything in life, there are always exceptions and sometimes just the sheer desire to do things differently!!