Hey everyone,
I’m working on a project to make our form submission process more efficient. Right now, we have a Google Form linked to a spreadsheet. When an employee submits the form, a script creates a new Google Doc for each submission.
What I want to do is have all these submissions go into one big Google Doc instead of creating lots of separate ones. This way, employees can see all their submissions in one place.
Here’s what I’m thinking:
- Keep the current script that converts form data to a Google Doc
- Add a new part that copies this new doc into a main document
- Delete the individual doc after copying
Is this doable with Apps Script? Has anyone tried something similar?
Here’s a simplified version of what I’m using now:
function handleSubmission(event) {
const data = event.values;
const mainFolder = DriveApp.getFolderById('abc123');
const template = DriveApp.getFileById('xyz789');
const newDoc = template.makeCopy('Submission ' + data[0], mainFolder);
const doc = DocumentApp.openById(newDoc.getId());
doc.getBody().replaceText('{{Name}}', data[1]);
doc.getBody().replaceText('{{Date}}', data[2]);
// More replacements...
doc.saveAndClose();
}
Any ideas on how to modify this to achieve what I’m after? Thanks!