0
votes

Basically, I have a Google Form that feeds into a Google Sheet, and I want to filter out all the responses that start with a space (which are spam). I have a second sheet in the file that filters out all the spam rows in the Responses sheet such that this Clean sheet has only the desired rows. This works perfectly, but the issue is that there are so many thousands of spam responses that it takes a while a while for this Clean sheet to load. So, I would occasionally like to run a script (I assume it can't automatically run itself, but let me know if that is possible) to delete all the spam rows in order to make everything load faster.

I found this question where the answer gives a script that deletes rows that are older than one week. I was hoping that somebody could write one like this that deletes rows where the response starts with a space. Or, if somebody has a better solution for my entire workflow, I am open to that, too.

1

1 Answers

0
votes

function onMyFormSubmit(e) { var sh=e.range.getSheet(); var resp=e.values.shift();//remove timestamp for(var i=0;i

I used an installable trigger for my testing

onFormSubmit Event Object