"Add a new row to another table..." updates instead of creating

Iโ€™m using an โ€œAdd a new row to another tableโ€ฆโ€ action to create a entry in a subtable. But its updating the existing record instead of creating a new one. Is this a new bug or something?

0 8 538
8 REPLIES 8

recently APIs of Appsheet was bit unstable, I have been in touch with Appsheet dev team for almost month. Action to add new records might have connection with APIs, better to raise ticket to support@appsheet.com

I havenโ€™t noticed this. Perhaps you should write to support@appsheet.com.

@tsuji_koichi & @Kirk_Masden Iโ€™ve emailed support with the issue. Thanks for your help

If you attempt to add a record with the same key as existing record, the add will automatically be turned into an update. You can confirm whether this is happening by checking โ€œAddโ€ end record in the Audit History. If the โ€œAddโ€ end Audit History record contains the property โ€œUpdateExistingRecordโ€ and the key value of the updated record, then the โ€œAddโ€ was turned into an โ€œUpdateโ€.

This is by design as part of the โ€œlast writer winsโ€ conflict resolution strategy. If two users attempt to โ€œAddโ€ the same record, the first โ€œAddโ€ to reach the server is treated as an โ€œAddโ€. The second โ€œAddโ€ to reach the server is treated as an โ€œUpdateโ€. To signal that this has occurred, we set the โ€œUpdateExistingRecordโ€ property in the Audit History for the second add.

I am not certain that is what you are reporting here, but it sounds like it might be.

@Phil ok, Iโ€™ll check it out. I thought Iโ€™d set the key column to unique IDโ€ฆ

Hi,
Can this be considered a feature?
I will have instances where columns will need to be set based n an action. But I donโ€™t know if it will be an update to a row or if the row will need to be created.
Can I use ADD and expect that if the row exists it will be coverted to an Update?

Hi Penny,

If you Add a record to a table and specify a key value that matches the key of an existing record in that table, then AppSheet will definitely turn the Add into an Update. The field values from the Added record are copied into the existing record. This is the result of our โ€œlast writer winsโ€ conflict resolution strategy described above.

You can rely on that behavior. We have considered adding richer conflict resolution strategies in future, but we if we do that we must provide an option to preserve the current behavior. That is essential to maintain backward compatibility for existing customers who rely on this behaviorโ€ฆ

Thank you

Top Labels in this Space