I've recently used Suyash Gandhi's code from another thread in order to count the number of emails under a specific label in my Gmail account. Below is the code I used/copied.
function CountVoicemail()
{
var label = GmailApp.getUserLabelByName("X140");
var labelname = label.getName();
var mails = label.getThreads();
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Data Sheet");
var date = new Date();
sheet.appendRow([labelname, date, mails.length]);
}
I've set up a Trigger for this code to execute it on a daily basis at around 7- 8 PM. The code worked wonderfully for a few days and would add a new row of data every time it was triggered until the code all of a sudden stopped adding new rows at around the time it reached Row 8 in the Sheet it was modifying.
I've checked the project's trigger log and it doesn't record any errors. When I try to execute the code, it tells me the code has executed correctly despite the fact that no new data/row has been added to the Google Sheet. Is there something wrong with the appendRow
statement?