这是记录非营利性住房开支的基本理论。 形式和目标领域列于下文。 我试图这样做,以便在提交材料时,将上载的档案从表格本身改用田地。 我想使用的田地是日期pi,两处是缩小面积的,一个包括数量在内的短处。 如今,google在结尾处用“上载名称”来重新命名档案。 我也想删除这一点。
我找到了一些答案,可以追溯地重新命名所有上载体触发器,但不会自动这样做。
外地细节
- submissionDate - a datepicker
- personName - Dropdown of names
- expenseType - Dropdown with strings like food, supplies, and so forth
- expenseAmount - Number, usually in ##.## form.
目标档案名称:提交文件
非常感谢你们的帮助!
这是不完整的,我不知道有正确的途径去找田。
function onFormSubmit(e) {
var form=FormApp.getActiveForm();
// returns the total number of form submissions
var length=form.getResponses().length;
//replace QUESTION NUMBER through the index of the question prompting the file upload - keep in mind that the first question has the index 0
var id=form.getResponses()[length-1].getItemResponses()[QUESTION NUMBER].getResponse();
//getResponses()[length-1] retrieves the last form response, accounting for the fact that the first index is zero and hte last length-1
var file=DriveApp.getFileById(id);
// store filename in variable
name = file.getName();
//Removes the built in Name added by google
var originalname = name.split( - )[0]
// !! Missing, get responses from specific fields, including converting date picker into yyyymmdd format
var newname = datefield+namefield+typefield+originalname
file.setName(name);
}