I have a clone app (un-deployed) that I use for testing prior to applying changes to the deployed version. In the clone app, I setup a simple bot that should add a row to another table using values from the current row once the user changes [STATUS] to “COMPLETE”.
When the bot is triggered, Instead of adding a new row to the bottom of the backend Google Sheet, the bot is replacing rows at the top of the sheet.
The bot only adds new rows to the bottom of the backend sheet if RowNumber is set as the key column, however, it’s my understanding that assigning row number keys is not a best practice.
Records get overwritten if you try to use the same key value. What are you using as the key value? Yes, using _rownumber is bad, but it’s better than using something that could easily be repeated, such as a date when you could have multiple records on one day. You should use UNIQUEID() 99% of the time.
Before posting, I tried using a dedicated column named KEY COLUMN with initial value expression CONCATENATE([UNIT],[UNIT RATE],[EMPLOYEE ID],[DATE]). I thought the dedicated column would produce reliable key values, but the top rows keep getting replaced unless I have the key set to row number.
The term “dedicated key column” refers to the data inside the column being dedicated as the key value. Meaning, do not use app data in your keys. Instead use the something like UNIQUEID() function. It is random enough to prevent row key clashes.
I have a similar problem. I set up a grouped action to add multiple rows in table B from a record in table A. The action works properly when I manually run it. I use the automation to set up a trigger (when a new record is added to table A) to run the grouped action. The grouped action keep overwriting in the same row (the bottom of the table) with a bad ID number (-1). I don’t know why the behaviors are different.
My table key is a running ID number with the initial value of (_RowNumber)-1.