我有一个存储表单提交的 Google 工作表,我正在尝试使用 onUpdate 触发器运行 Google 应用程序脚本,以删除通用文本块。我已运行脚本并收到“执行完成”消息,但脚本运行后没有任何反应。
function onUpdate() {
function replaceEverywhere () {
var spreadsheet = SpreadsheetApp.openById("1Gm1B-IGifpPuRsVj5mFbIwx4T7g1VuTM0nlzDgHzzFo");
var = sheet SpreadsheetApp.SetActiveSheet(spreadsheets.getSheets()[0]);
var textFinder = sheet.createTextFinder("From: Leigh-on-Sea SS9, UK
Building No. Street & Postcode: ");
textFinder.replaceAllWith(" ");
}
}
理想情况下,最终结果是自动从现有条目和新条目(J 列中)中删除文本块...然后我需要 J 列中的新条目来替换/更新现有的 Google 日历事件位置...是有一个插件可以在触发器上更新工作表中的事件位置吗?
尝试这样:
function replaceEverywhere() {
var ss = SpreadsheetApp.openById("1Gm1B-IGifpPuRsVj5mFbIwx4T7g1VuTM0nlzDgHzzFo");
var sheet = ss.getSheets()[0];
var textFinder = sheet.createTextFinder("From: Leigh-on-Sea SS9, UK Building No.Street & Postcode: ");
textFinder.replaceAllWith(" ");
}
function onUpdate() {
replaceEverywhere()
}