New rows in Google Sheets from Coda

I have a table where a user can select specific rows with a check box column.

I want to create a button that sends ALL those rows to a Google Sheet.

The challenge is that the Google Sheet pack requires the specific row each time. That forces me to first determine the last row in the Google Sheet and concatenate a row range. And then track a variable so that I can increment by one for each row.

This is all doable (I think), but I am posting here because I’m wondering if there isn’t a simple way that I somehow missed in the documentation.

For example, I was hoping that if I left the row range field blank that it would automatically add it to the last row in the Google Sheet, but it just gives me an error.

Source Table:

Destination table:

(the data goes straight to Google Sheets with the add row pack, and then I can see it back in Coda on this table when it syncs)

I only want to send to bullshits the 2 rows in the source table that have been checked. Do I need to perform all the calculations for the google sheets row range, or is there a simpler way? (I am not talking about how do I filter out just the rows I want to send. I am only asking about how to get them into Google Sheets.)

I am hoping that somebody that has experience sending a lot of data to Google Sheets sees this post and maybe shares how they made it work.

This works fine when I am adding a single row to the Google Sheet, but I need to be able to add 20, 30, 40 rows. That is why I am asking if there is a simpler way that I just haven’t figured out that maybe somebody here knows.

I am also wondering how reliable the approach that I am about to try will be.

I ended up answering my own question, and I want to share here what I did. Especially because I did look for this information in the forum and I couldn’t find anything detailed enough or in the official documentation either.

What you need to do is:

  1. sync the table from Google Sheets so you can calculate the number of current rows.
  2. Use that information to build a string with the range that you need from each row in your source table.
  3. Create a Google Sheets Coda Pack button on that table that uses the column you created in step number two above as the range.
  4. Create a canvas button to click on the Sync to Google Sheets button on the table

This is probably a lot more clear if you look at the video I recorded here.

The official documentation is a bit sparse, so after figuring this out, I’m putting it here so that maybe it will help somebody else.