Reputation: 103
I have been looking for a way of automating at work the google forms we need to create for Gsuite but in this documentation for the life of me I can't find how to add questions that allow me to have a file upload.
Like this image.
Upvotes: 2
Views: 1340
Reputation: 1
Try this way -
function myFunction() {
var frm = FormApp.openById('1TGGBsIC6NjZ9WScJHa4SvsRNmj4MaCOZGS_aLOEcD-8');
var itms = frm.getItems(FormApp.ItemType.FILE_UPLOAD);
var itm = itms[0];
Logger.log(itm.getTitle());
Logger.log(itm.getType());
}
Upvotes: -2
Reputation: 2331
Unfortunately, there's no way to programatically add this option to upload file in a form via Apps Script - there are existing issues logged with Google here:
You can subscribe to this by clicking on the star ☆ next to the Issue number in order to receive updates and to give more priority to the bug.
I landed up here because when we reverse engineer it to see what type is Apps Script identifying form items that are created manually for the upload option, it gave out 'FILE_UPLOAD' which is not a documented ENUM per official docs.
Upvotes: 1