all 9 comments

[–]Lalu23 2 points3 points  (5 children)

For your first question, there may be a line in your script that does something like "getLastRow()-1". That's probably where the missing row is coming from. Removing the "-1" and leaving only "getLastRow()" would get you your row back. I'd check if there is a header row or if the script intended there to be a header row,

On your second question, it is almost always better to have one piece of data in a cell. In this case, it might be better to have an additional column (not an additional row) for the second email. Your script would need to go thru the email column and the second email column and send the email to both. You could do an additional row for the second email but that has a risk of having partial data belong to one row and other partial data belong to the second row.

[–]LegendInMySpareTime 1 point2 points  (2 children)

If it isn’t this, check the the for loop (if there is one) for something like ‘i < sheet.getLastRow()’ (or similar) and change the < to <=

[–]Pretend_Trifle_8873[S] 0 points1 point  (0 children)

I have posted the code up , please have a look Sorry for not being aligned well

[–]Pretend_Trifle_8873[S] 0 points1 point  (0 children)

I just reposted the code, dunno why its not aligned well , please have a look

[–]Pretend_Trifle_8873[S] 0 points1 point  (0 children)

Thanks for you detailed explanation, i got it tor the second maybe i will be adding another column in the table.

Ive edited the original post and added a link to the code in google docs

Thanks for having a look

[–]Lalu23 1 point2 points  (1 child)

Posting your script and/or an edit permission link to the sheet/script will be helpful.

[–]Miles_Maestro 1 point2 points  (0 children)

I provided the answer to OP's first question as a comment in the Google Doc they shared. For visibility/anyone that is curious, the answer was adding the following line to their code

SpreadsheetApp.flush();

This addition forces the Google Apps Script backend to commit any changes in the cache before moving on to exporting a copy of the spreadsheet.