Update Duplicate Data in Sheets

Hi, I am having a spreadsheet like this

I have tried updating the values, but only the first one of the duplicates work, then the execution will just be looping over that one and not update the other rows.

Here is an example of a workflow:


Because the key in the Google Sheets node needs to be unique, and since all zips are 10080 it updates the first that it finds. Also, the split batches node in your workflow is not needed.

1 Like

If I remove the Split into Batches it still doesn’t work. Is there a way to bypass this?

No, as I mentioned, the key in the Google Sheets node has to be unique, else the node will always update the first record. This is how the Google Sheets API works. You can add another column with a unique value, like a number, and every time you add a new record, you increment that number.

Regarding removing the split batches node, that was only a suggestion, as you do not need it since n8n automatically iterates over all input items.

1 Like

Thanks. I have been researching for a way to auto increment the number in Google sheets on a new column, because the data come from a WP Forms integrated, but unfortunately I didn’t find a way to do that automatically. Do you know of a way out? Thanks.

Is not WP Forms adding more data to the sheet? Nothing that you can use as a primary key? Maybe IP? email? Phone?

1 Like

All the data is same(that is when someone fills the form twice) , but lemme try figuring out what changes I could make to get a unique key. Thanks

creates a new column and puts the =row() this formula no google spreadsheets will return the current row number.