Fixed
Status Update
Comments
as...@gmail.com <as...@gmail.com> #2
Error in first linked-copy method...should have said:
var form = FormsApp.getFormById("gsfdsfgd"); //return form object
var ss = DocsList.openById("gsfdsfgd");
var mappingObject = ss.getFormMappings(); //return an immutable mapping of form questions to columns
var formCopy = form.makeCopy("new form name");
var ssCopy = ss.makeCopy("new SS name");
ss.connectToForm(formCopy, mappingObject); //connect SS to Form, map all relationships
var form = FormsApp.getFormById("gsfdsfgd"); //return form object
var ss = DocsList.openById("gsfdsfgd");
var mappingObject = ss.getFormMappings(); //return an immutable mapping of form questions to columns
var formCopy = form.makeCopy("new form name");
var ssCopy = ss.makeCopy("new SS name");
ss.connectToForm(formCopy, mappingObject); //connect SS to Form, map all relationships
gk...@google.com <gk...@google.com>
db...@gmail.com <db...@gmail.com> #4
Please refer to StackOverflow question 14658353, "How to generate a pre-filled form URL for Google Form".
http://stackoverflow.com/questions/14658353/how-to-generate-a-pre-filled-form-url-for-google-form/14712068
To complement the initial API request, I'd like to see the ability to retrieve the id of form questions, to support automation of pre-filled for generation, for instance.
To complement the initial API request, I'd like to see the ability to retrieve the id of form questions, to support automation of pre-filled for generation, for instance.
as...@gmail.com <as...@gmail.com> #5
Totally agreed with #4. And this should be something that can work on secure (Apps Domain) and public forms. I've been scraping the form to find question IDs and unfortunately this only works for public forms.
ht...@gmail.com <ht...@gmail.com> #6
There is also an abysmally small amount of information documenting the API of Forms in Google Apps Script.
I have been trying for hours to figure out how to dynamically build the ListBox of the form attached to a Docs Spreadsheet (basically, ensuring a user list is always up to date based on values from the spreadsheet itself), and only just now discovered that everything is apparently read-only (despite there being methods called "set"). Not cool, I should have been warned of this.
I have been trying for hours to figure out how to dynamically build the ListBox of the form attached to a Docs Spreadsheet (basically, ensuring a user list is always up to date based on values from the spreadsheet itself), and only just now discovered that everything is apparently read-only (despite there being methods called "set"). Not cool, I should have been warned of this.
db...@gmail.com <db...@gmail.com> #7
@htwiz2002 - This issue is about the lack of an API for the document type "form". On the other hand, I believe you are describing a problem you are having with the UiApp service, in which you are struggling to build a dynamic form in a google apps script that you are deploying as a web app.
If I've got that right, you should post your question onstackoverflow.com , the official community support site.
http://productforums.google.com/forum/#!msg/apps-script/mZEVqsmTqrQ/
If I've got that right, you should post your question on
ht...@gmail.com <ht...@gmail.com> #8
Nope, I am indeed commenting on the Document type "form". ;)
I can, for example, change the title and help text of the form when it is
opened by the owner, but I seemingly have no way to edit the items/options
of the list when the question type is "chose from a list". I just don't
know how to add items (or remove them) as I don't have documentation or a
tutorial on how to do so. Guessing and experimentation can only go so far
after all....
I can, for example, change the title and help text of the form when it is
opened by the owner, but I seemingly have no way to edit the items/options
of the list when the question type is "chose from a list". I just don't
know how to add items (or remove them) as I don't have documentation or a
tutorial on how to do so. Guessing and experimentation can only go so far
after all....
ck...@gmail.com <ck...@gmail.com> #9
Forms support is already live. Go play with FormApp object.
ht...@gmail.com <ht...@gmail.com> #10
I have, that's what I've been playing with, but without documentation,
progress is extremely slow, because I have to shoot in the dark for what
I'm trying to do.
progress is extremely slow, because I have to shoot in the dark for what
I'm trying to do.
as...@newvisions.org <as...@newvisions.org> #11
Documentation for this hasn't been released as they haven't officially released the service yet. This literally just came online last night. Hold thy horses;) Documentation will likely be forthcoming within the next 24 hours. I/O is upon us.
ht...@gmail.com <ht...@gmail.com> #12
Oh? That would make sense. I hadn't tried using GAS with forms until
yesterday, so I had no idea it just went up. ;p Things are making sense now!
yesterday, so I had no idea it just went up. ;p Things are making sense now!
gk...@google.com <gk...@google.com> #13
as...@gmail.com <as...@gmail.com> #14
Thank you, thank you, thank you! Awesome work team.
fa...@gmail.com <fa...@gmail.com> #15
This is great. Thanks you guys!!!
[Deleted User] <[Deleted User]> #16
This is exactly what we wanted! Thanks!
ht...@gmail.com <ht...@gmail.com> #17
Yes, super awesome, and the form-update script works flawlessly!
On Wed, May 15, 2013 at 12:18 PM,
<google-apps-script-issues@googlecode.com>wrote:
On Wed, May 15, 2013 at 12:18 PM,
<google-apps-script-issues@googlecode.com>wrote:
db...@gmail.com <db...@gmail.com> #18
Pretty cool! Spent a busy day playing with script in Docs and Forms. Some issues...
Can only get menu to show up in forms editor if the script is attached to the form editor; not from a script in a spreadsheet attached to a form, not from a stand-alone script, even if those scripts created the form. (I'm just running the default demo script, btw.)
Can only get menu to show up in forms editor if the script is attached to the form editor; not from a script in a spreadsheet attached to a form, not from a stand-alone script, even if those scripts created the form. (I'm just running the default demo script, btw.)
ht...@gmail.com <ht...@gmail.com> #19
This would make sense, as the menu should be called after the Forms Editor is loaded (custom menus are not persistent). Now, if you were able to make the script add a script to the form that implemented the menu, that might work. :) But it would have to be called onLoad of the form.
[Deleted User] <[Deleted User]> #20
Please do it!
je...@gmail.com <je...@gmail.com> #21
Google...your guys are amazing
je...@gmail.com <je...@gmail.com> #22
Google...your guys are amazing
su...@gmail.com <su...@gmail.com> #23
is this out yet?
ka...@gmail.com <ka...@gmail.com> #25
[Comment deleted]
Description
The new forms product breaks the linkage between Spreadsheets and Forms, which makes the replication of spreadsheets with formula-dependencies on form data impossible. This is a major problem for power users (enterprise, K12).
Unless the Forms team is planning on restoring the linkage soon, a programmatic way to copy forms and spreadsheets as a connected object is very much needed.
This routine might look something like this:
var form = FormsApp.getFormById("gsfdsfgd").getConnectedForm(); //return form object
var ss = DocsList.openById("gsfdsfgd");
var mappingObject = ss.getFormMappings(); //return an immutable mapping of form questions to columns
var formCopy = form.makeCopy("new form name");
var ssCopy = ss.makeCopy("new SS name");
ssCopy.connectToForm(formCopy, mappingObject); //connect SS to Form, map all relationships
--OR--
this...
var form = DocsList.getFileById("gsfdsfgddsfdsa");
var ss = DocsList.openById("gsfdsfgdasddsfdsa").getConnectedSpreadsheet();
var mappingObject = form.getFormMappings(); //return an immutable mapping of form questions to SS columns
var formCopy = form.makeCopy("new form name");
var ssCopy = ss.makeCopy("new SS name");
form.connectToSpreadsheet(formCopy, mappingObject); //connect Form to SS, map all relationships (form to sheet, questions to columns, etc.)
Here is a sketch of what the Forms API might need (not that I have any experience with API design;)
FormsApp.getFormById("gsfdsfgd");
SpreadsheetApp.getConnectedForms(); (leave open to programmatically creating many to one relationships)
FormsApp.getConnectedSpreadsheet();
form.getQuestions() - return an array of question item objects
form.getMappings(); - return an object that somehow provides the sheet id associated with the form and all column ids associated with questions
question.getText() - return text of question.
question.setText() - set text...
question.setHTML() - YAY!
question.getType()
FormsApp.QUESTIONTYPE.LISTBOX.setItems() - allow an array of values to be dynamically assigned to question types where lists are concerned (This is HUGELY important)
question.getMapping() - return an object that allows us to know which sheet and column correspond to a given
question.setMapping()
For robustness, many of these methods would require an immutable column ID can be understood in the context of the Spreadsheet object...Presently, if one drags a form-connected column around, the form somehow "knows" that the new data should go into the same column, so there must be some underlying immutability to the column-form relationship that is not order-dependent. I'm assuming this could be exposed via an API.
form.getMappings() - return an array of objects like the one described above
form.setMappings() - set the mappings of form questions to column Ids
form.addQuestion()
form.deleteQuestion()
etc.
This remains an incomplete sketch....
Others with better experience in API design, please chime in!