0

I'd like to create a form by google script.

This is pretty easy but I'd like to attached this form to a spreadsheet (no only the response), like I would have created it by the UI.

Is that possible ? Given the Formclass or FormApp is doesn't seem so. Is there a way around ?

EDIT: My goal was to create the form with the script and having the same result as if the user had had the form created from the UI interface (the main difference being having the form menu in the SS UI). It's apparently not possible.

Eagle1
  • 810
  • 2
  • 12
  • 30

1 Answers1

0

You're right - it's pretty easy once you have the trick. Use FormApp to get the published URL of the form, UrlFetch to grab its html, then the HtmlService to present the form in the spreadsheet's UI.

See Single Google Form for multiple Sheets.

Community
  • 1
  • 1
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
  • an interesting answer & solution however it doesn't seem to do what I mean. I want to have the form attached to a spreadsheet as if the user had it created by inserting a form in the UI menu. – Eagle1 Jul 22 '14 at 07:15
  • Then I don't understand what you're asking for. Please make your question more clear. – Mogsdad Jul 22 '14 at 11:05
  • well, you know how it is when you create a form in a spreadsheet with the menu? You have access to it via the menu of the SS. Because when I create a form with scripts, – Eagle1 Jul 23 '14 at 07:28
  • A form can only be associated with one spreadsheet that way. This answer is the closest you'll get to what you're describing. (or almost describing 8) – Mogsdad Jul 23 '14 at 12:28
  • sorry I got cut off in my message I didn't think it had been sent. Your answer showed me a way to go, I'll make do with it thank you. – Eagle1 Jul 24 '14 at 20:39