gpt4 book ai didi

javascript - 谷歌脚本电子表格未在执行时更新

转载 作者:行者123 更新时间:2023-11-28 07:33:07 24 4
gpt4 key购买 nike

当我发布应用程序时,在开发模式下,电子表格会更新,但在执行模式下却不会更新,即使电子表格拥有任何匿名用户编辑它的所有权限。

    //Code.js:
function doGet(e) {
return HtmlService.createTemplateFromFile('Form.html')
.evaluate() // evaluate MUST come before setting the NATIVE mode
.setTitle('Name To Appear in Browser Tab')
.setSandboxMode(HtmlService.SandboxMode.NATIVE);
}

function processForm(theForm) {
var fileBlob = theForm.picToLoad;
var fldrSssn = DocsList.getFolder('For Web Hosting');
var createdFile = fldrSssn.createFile(fileBlob);
var fileUrl = createdFile.getUrl();
var name = theForm.user_name;
var files = DocsList.find('prat');// this is an array of file objects that include the term 'thisisthesheetIwant'
var file = files[0];// I take the first one
var ss = SpreadsheetApp.open(file);// using that file object I can open a spreadsheet
var sheet = ss.getSheets()[0];


var lastRow = sheet.getLastRow();
sheet.getRange(lastRow+1, 1, 1, 2).setValues([[name,fileUrl]]);
return true;


}

最佳答案

如果您没有重新发布新版本,它将继续以执行模式运行旧版本。开发模式运行当前版本。 Exec模式运行最后发布的版本

关于javascript - 谷歌脚本电子表格未在执行时更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28903148/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com