-1

I have a template form that will go out 200+ times. The only thing that’s different is the name/Id which I don’t want to be editable so it’s a required multiple choice with only one answer. I’m saving all forms in my GoogleDrive, and I want to use a script that will get the IDs of each form, open my drive app, pass the new id, get the responses, then populate them to a Spreadsheet. I figured out how to get the IDs as a variable, but I can’t seem to figure out how to get the item responses to my spreadsheet. Is this possible? I know I can appendRow(), but I’m not sure what to use as the parameters. I’ve tried using appendrow(form.getItemResponses());, but that’s not working.

kevin
  • 9
  • 1
  • Does this answer your question? https://stackoverflow.com/questions/26253706/how-to-extract-response-items-from-a-google-form – gloo Jun 22 '22 at 00:20
  • 1
    Also consider this simple, code-free approach if you don't need to further manipulate data before storing it: https://support.google.com/docs/answer/2917686#zippy=%2Cchoose-where-to-store-responses – gloo Jun 22 '22 at 00:23
  • The code-free approach would be great, but I think the max tab limit for a sheet is 200, and I’ll have 350 response tabs. It’ll be very messy, so I thought the cleanest, simplest way would be to retrieve the responses by the formId from my Drive folder. I could add an onFormSubmit trigger, but I think I would have to authorize it manually for each form which could take a while. I may do that if I can’t figure out how to pull responses by formIds. – kevin Jun 22 '22 at 01:06

1 Answers1

0

I'm not familiar with Apps Scripts/Google Drive, but these are alternate methods I would use:

No code method:

  1. As gloo commented, a Google form can be configured to save to an existing spreadsheet. Simply configure all your 200+ forms to save to the same Google sheet.

Fewer forms, more code:

  1. You only need to create a single form (your template form).
  2. Create a customized version of your Google form by scraping the form data.
  3. Now when you send this form to people, you can embed the name/id in the URL so it is different for each recipient. Your custom form is rendered with this embedded name/id data. (Hash/encrypt the name/id to prevent "hacking" the form's URL params.)

I recently made a simple custom Google form that is very similar:

  • Original Google form
  • Customized Google form
  • My custom Google form doesn't need to show unique name/id's, but it does render the form with values it "remembers" from localStorage.
  • I used a simpler method to scrape the Google forms data. (For your case, you can probably just manually scrape the form data you need because the values should remain constant.)
Leftium
  • 16,497
  • 6
  • 64
  • 99