I have several Google forms which are reused frequently with around 300 - 400 form submission each time.
Until now, I have two ways to reset form, by hand:
- Deleting the form while keeping the form editor opened.
- Select the rows that contain form submissions, right click and choose "Delete ... rows".
With script, I've have no luck finding such method like form.reset()
.
The method .DeleteRows(fromRow, to Row)
just delete the rows, but doesn't affect the counters.
So, how can I use Google apps script to automate the "reset form" task?
Or, how to mimic the second way in script?
Thank you!
Google Forms has created a new form editor (released just a few weeks ago). This new form editor has an option for "Delete all responses." So one option would be to re-create the form in the new form editor. (From a new spreadsheet, click Tools > Create a form).
Note: This new form editor isn't available to Google Apps users yet.
I have a working solution, that uses
deleteRows()
. I'm not sure why that didn't work for you, it would be interesting to see your code.The new Forms product (February 2013) is quite different than the legacy forms - this solution will work on legacy forms only.
Anyway, here's what I have, with before & after screenshots. The
tidy()
function can be called by passing in the number of rows to be removed, or you can call it from a menu as demonstrated here. A more complete version of this script is available as a gist.Before
During
After