Bayrem Ben Alaya
Bayrem Ben Alaya

Reputation: 297

How to attach google form to google spreadsheet using google apps script?

I am trying to attach a google form to a google spreadsheet using the script, i went through the Spreadsheet documentation and i found a getFormUrl() function but no setFormUrl(), if someone could help me i would really appreciate it.

Upvotes: 0

Views: 287

Answers (2)

Kacper Knapik
Kacper Knapik

Reputation: 323

That's what I did:

  • I created Google Form,
  • then added some scripts in it, to do stuff,
  • and finally form returned responses == spreadsheet with answers from this form.

Not sure if that's what you are looking for, but if so, tell me, I'll give you more details.

Upvotes: 1

Bayrem Ben Alaya
Bayrem Ben Alaya

Reputation: 297

I went through the Google Form documentation and i found this :

// Open a form by ID and create a new spreadsheet.
 var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
 var ss = SpreadsheetApp.create('Spreadsheet Name');

 // Update the form's response destination.
 form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId());

Works fine for me.

Upvotes: 0

Related Questions