

Okay if I could impose upon you for some debugging… Sht.getRange(rowIndex, colIndex, URLs.length, URLs.length).setValues(URLs) Var sht = sSht.getSheetByName("A_Sheet_Name_To_Record_File_URLs") Var sSht = SpreadsheetApp.openById(sheetID) URLs.push() //Get Filename and File URL into an array Var files = DriveApp.getFolderById(folderID).getFiles() However your code block works if and only if you are using an add-on to save your gmails to gDrive. No matter what, Drive API is a bit faster than DriveApp class sometimes. The processes and the parameters are a bit different then built-in DriveApp actually. If you explicitly know what to do, then no. If (typeof moveToLabel != 'undefined') how would you include something to copy PDFs and files into a Gdrive folder then? Is there something inherently more difficult about using the Drive API? var moveToLabel = GmailApp.getUserLabelByName('MOVE_TO_LABEL') // <- Uncomment to move to new label after download Var sh = ss.getSheetByName("Email") // <- RENAME TO SAVE TO DIFFERENT SHEET Var ss = SpreadsheetApp.openById('GSHEET_ID') // <- INSERT GSHEET_ID Var label = GmailApp.getUserLabelByName('YOUR_CUSTOM_LABEL') // <- RENAME TO YOUR CUSTOM FILTER LABEL Matching emails are downloaded, and then the label is removed Save script and click run, then authorize Replace 'GSHEET_ID' with the ID from the sheet URL Replace 'YOUR_CUSTOM_LABEL' below with the new label name

Create filter rule in Gmail to apply custom named 'label' DOWNLOADS NEW GMAILS WITH MATCHING LABEL TO SHEET The only thing you have to edit is the label-name to monitor, and the GSheet_ID. This lets you define the email-matching logic using Gmail’s search operators, instead of having to edit the script code.


The code that is commented out is the block that's not working correctly. I'm stuck on saving the Email attachment to Google Drive. I'm fairly close to completing my Google Apps script project, which is parsing a simple 2 line Email and adding the attachment link (Attachment saved to Google Drive) to Google Sheets.
