TLDR: Adding Google’s eSignature field to documents revokes script access. I used openById to be sure this was the issue and it was…
I was creating a script to pull dates from a set of google docs. As I was updating the Doc I began getting the following error:
Exception: Unexpected error while getting the method or property openById on object DocumentApp.
^^ I figured out this was caused by adding the new eSignature Field to the doc. When removed, the script would behave normally and retrieved the desired info from the doc, but as soon as an eSignature field was added the doc would immediately become inaccessible to the script.
I’m assuming Google’s rational for this is that documents with eSignatures should be treated something like legal documents or PDFs; they should be uneditable since changes after a signature void consent? Nevertheless the fact that eSigantures are not compatible with Scripting does severely limit their usability.
In my example I was pulling dates from the signed doc to feed into an excel sheet to keep track of which documents had been signed and dated. I guess I just need to go old school and have people initial the doc?
Maxim Kolb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.