Trying to create an ID column and autoincrement each additional row created with Google Sheets

Hi @samk, I had the same issue quite recently but not sure what's the timing you want this to happen but here's my hack on it. This is a simple solution if you are using 1,2,3,4... as your primary key.

  • On your GSheet, set column A as primary ID for that specific table.
  • Set A2 as 1 or whatever number you want to start at
  • A3 would be =if(B3,A2+1,) then drag that thing down.

Every time you append a row/entry in that sheet, the id for that row will be created. On your retool side, you have to refresh the data/run your gsheet resource to reflect the appended row containing its primary key (column A).