1
votes

When I tried to add a new editor, (only 1) using the following line of code:

myfile.addEditors([emailsAdd[i]]);

I got the error message:

"We're sorry, a server error occurred. Please wait a bit and try again."

I tried to add the user manually and I came to know that his email address is not associated with a Google acoount.

Are you sure? You are sending an invitation to xy. Since there is no Google account associated with this email address, anyone holding this invitation will have access without signing in."

However, yesterday I was able to add an email addresses not associated with Google accounts (same snippet, but using another script and another spreadsheet). Both spreadsheets are new spreadsheets, both spreadsheets' access is set to private. Why does it sometimes work to add new users without GA and sometimes it doesn't? Is there a way to control this behaviour?

Thanks, Andreas

1
I did tried for both scenarios and it worked fine. Not able to reproduce the errors.KRR

1 Answers

0
votes

You are adding editors in two different ways, one manually, and one with code. With code, there is no warning if the email address doesn't exist, or the email address is not associated with a Google account.

When adding an editor manually, you will get a warning, BUT you can still add them.

I would be nice if there was a way to determine in code whether the editor email address has a problem or not. You could suggest that as Feature Request in the Apps Script Issue tracker: Apps Script Issue Tracker