我请求你的帮助,因为我对编程知之甚少! ;-(
我有一个客户注册的谷歌表格。 每个注册的联系人都会添加到相关表格中,指示注册日期和时间(A 列)
我想知道是否可以使用与发送表单关联的脚本将此值添加到 J 列: 注册日期 + 7 天
感谢大家的宝贵帮助!
最佳答案
您可以尝试在提交表单时写上日期。使用 Form Submit触发运行此功能:
function newRow() {
var sprsheet = SpreadsheetApp.openById("your sheet Id");
var sheet = sprsheet.getActiveSheet();
var lastRow = sheet.getLastRow();
//Gets the current date and adds 7 days to it
var date = new Date();
var value = new Date(date.setDate(date.getDate()+7));
//"10" is the J column
sheet.getRange(lastRow, 10).setValue(value);
}
引用资料:
关于javascript - Google Scripts - 添加天数 -,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59053515/