Reputation: 11
I can create the form on google docs by using google drive API. But im unable to find the APIs to design that form (adding fields/items). Can i have any solution like this - APIs to design the forms - can i use the google app script from my server? - How can i publish the google app script to use that thing from my server. example please.
Upvotes: 0
Views: 234
Reputation: 927
Unfortunately, so far the use of Google Apps Script for external purposes is not possible.
It can only be used on Google Drive, Gmail, Google Sheets, Google Sites etc. It is not possible to use it on your server. I tried to do same thing a few months ago but found out the hard way that it wasn't possible.
Creating a form however, is possible.
In order to provide checkboxes, use the following implementation...
var form = FormApp.create('New Form');
var item = form.addCheckboxItem();
item.setTitle('What condiments would you like on your hot dog?');
item.setChoices([
item.createChoice('Ketchup'),
item.createChoice('Mustard'),
item.createChoice('Relish')
]);
Radio-buttons can be used like this...
form.addMultipleChoiceItem()
.setTitle('Do you prefer cats or dogs?')
.setChoiceValues(['Cats','Dogs'])
.showOtherOption(true);
Text-field items can be used like this...
var tfitem = form.addTextItem();
tfitem.setTitle('What is your name?');
You may want to check this link just in case
Upvotes: 1