Reputation: 1
is there any script or formula that can help me do the data cleaning. For example in the sheet below, https://docs.google.com/spreadsheets/d/1mLZ8TYNpNHVN1Kc8QF80Ns3RX-EXdSz5s9WmHoIS8Pw/edit?usp=sharing, I have "Form responses 1" which capture the data entry from google form and "cleaning data" sheet. I tried to use Arrayformula and Importrange but i cannot edit the data in "Cleaning data" sheet. Currently, I just copy and paste manually to the other sheet.
What I wanna do
Thank you!
Upvotes: 0
Views: 2008
Reputation: 201553
In your situation, how about the following sample script?
Please copy and paste the following script to the script editor of Google Spreadsheet. And, please install OnSubmit trigger to the function onSubmit
. When you use this script, please submit your Google Form. By this, the script of onSubmit
is run by firing the OnSubmit trigger.
function onSubmit(e) {
const range = e.range;
const srcSheet = range.getSheet();
const dstSheet = e.source.getSheetByName("Cleaning Data");
const srcRange = srcSheet.getRange(range.rowStart, 1, 1, srcSheet.getLastColumn());
const dstRange = dstSheet.getRange(dstSheet.getLastRow() + 1, 1);
srcRange.copyTo(dstRange, {contentOnly: true});
}
TypeError: Cannot read property 'range' of undefined
occurs. Please be careful this.Upvotes: 0