Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to set the folder where a google form is stored

I am creating a form though apps script. I am not sure how to put the form into a specific folder.

I am sure that it is easy, I am just missing something.

//Creation of Pay Form
const formfolder = DriveApp.getFileById('1XtKv79svMkMGGz-g0dr6p5JwqryEJxeU')
var custnamecell = theSheet.getRange("E1");
var custname = custnamecell.getValue();
var adrescell = theSheet.getRange("B3");
var adres = adrescell.getValue();
var title = (custname);
var discription = (adres);
var form = FormApp.create(title)
    .setDescription(discription);

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use the following code to create a Google Form and save it to a specific folder:

const formFolder = DriveApp.getFolderById('FOLDER_ID');
const form = FormApp.create('Form Name');
const formFile = DriveApp.getFileById(form.getId());
formFolder.addFile(formFile);
DriveApp.getRootFolder().removeFile(formFile);

Replace FOLDER_ID with the ID of the folder where you want to save the form.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading