Goal: create an apps script web app that opens a google doc and returns it's name
This functionality stopped working sometime in the last month or so.
function doGet(e) { var msg = "none;"; try{ var doc = DocumentApp.openById("1WYNw9IPcsYZXrvK7gOaoOLt7GPiaUhCJ5OEf79h~~~~"); msg = doc.getName(); }catch(e){ msg = e; } return HtmlService.createHtmlOutput(msg); }
Save and follow path for authentication
Publish / Deploy as web app with settings
Now try it out
Found and opened Intro
open the url in incognito and do not login to any account
Error message
Exception: We're sorry, a server error occurred. Please wait a bit and try again.
Edit: added the line msg = doc.getName();
This works for me even including a new incognito window and another account.
function doGet(e) {
var msg = "none;";
try{
var doc = DocumentApp.openById("docid");
msg = doc.getName();
}catch(e){
msg = e;
}
return ContentService.createTextOutput(msg);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.