Hey everyone.
I’m working on a script that will intercept emails, copy some details into a Gsheet, and copy the attachment into the Gdrive (while also putting a filepath into a cell for the row created per email).
The problem I’m having is that the actual file created isn’t a copy of the attachment file, it’s a 15kb PDF with the following contents:
Everything in here works, except for attachment.copyBlob()
- that’s creating the small bit of text you see in the images above.
You can see from the script fragment above that the attachment stuff is inside a loop;
newFilePath
.But when I tried return newFilePath
, it validated but it’s not actually returning a value; the filepath that’s reported is missing the file name.
The code is built for multiple attachments, but I really only need it for one. In this scenario, there will only always be one attachment - but I can’t find anything that shows how to code for a single thing, it’s all for multiple (which makes sense).
Thanks to you all!
User | Count |
---|---|
41 | |
35 | |
27 | |
23 | |
16 |