I have a google form that dumps into a spreadsheet. This form is constantly getting new submissions.
I need to do various different functions with this data and, in an ideal world, the form would dump the data in two places. These two places would not be mirrors of each other, but independent data sets that are both added to on the form submit.
This would allow me to delete/edit entries on the one with out changing/deleting the entries of the other.
If you could please advise, I would be incredibly grateful (I am a newbie and struggling).
Thanks so much!
CodePudding user response:
Here is a trivially simple way to do it:
function onFormSubmit(e) {
Logger.log(JSON.stringify(e));//this is worth doing for your own edification
const ss = SpreadsheetApp.getActive();
const sh1 = ss.getSheetByName('Sheet1');
const sh2 = ss.getSheetByName('Sheet2');
sh1.appendRow(e.values);
sh2.appendRow(e.values);
}
You will have to create an installable trigger
I know you will probably do this so I'll tell you now that you cannot run this function from the script editor without supplying the event object. I can't remember how many times I've written this statement.
