Genel özellikleri ve öğeleri içeren bir form. Özellikler arasında başlık, ayarlar ve yanıtların depolandığı yer bulunur. Öğeler, onay kutuları veya radyo öğeleri gibi soru öğelerini içerirken, düzen öğeleri sayfa sonları gibi öğeleri ifade eder. Formlara FormApp
adresinden erişilebilir veya buradan form oluşturulabilir.
// Open a form by ID and create a new spreadsheet. var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); var ss = SpreadsheetApp.create('Spreadsheet Name'); // Update form properties via chaining. form.setTitle('Form Name') .setDescription('Description of form') .setConfirmationMessage('Thanks for responding!') .setAllowResponseEdits(true) .setAcceptingResponses(false); // Update the form's response destination. form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId());
Yöntemler
Yöntem | Dönüş türü | Kısa açıklama |
---|---|---|
addCheckboxGridItem() | CheckboxGridItem | Yanıt verenin bir dizi onay kutusu arasından satır başına birden çok seçenek belirlemesini sağlayan, sütun ve satırlardan oluşan bir ızgara şeklinde sunulan yeni bir soru öğesi ekler. |
addCheckboxItem() | CheckboxItem | Katılımcının bir veya daha fazla onay kutusu seçmesine olanak tanıyan yeni bir soru öğesi ve isteğe bağlı bir "diğer" alanı ekler. |
addDateItem() | DateItem | Katılımcının bir tarih belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
addDateTimeItem() | DateTimeItem | Katılımcının bir tarih ve saat belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
addDurationItem() | DurationItem | Katılımcının bir süre belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
addEditor(emailAddress) | Form | Kullanıcıyı Form düzenleyici listesine ekler. |
addEditor(user) | Form | Kullanıcıyı Form düzenleyici listesine ekler. |
addEditors(emailAddresses) | Form | Belirtilen kullanıcı dizisini, Form düzenleyicisi listesine ekler. |
addGridItem() | GridItem | Yanıt verenin bir dizi radyo düğmesinden satır başına bir seçenek belirlemesine olanak tanıyan, bir sütun ve satır ızgarası şeklinde sunulan yeni bir soru öğesi ekler. |
addImageItem() | ImageItem | Resim görüntüleyen yeni bir düzen öğesi ekler. |
addListItem() | ListItem | Katılımcının açılır listeden bir seçenek belirlemesine olanak tanıyan yeni bir soru öğesi ekler. |
addMultipleChoiceItem() | MultipleChoiceItem | Katılımcının radyo düğmeleri listesinden veya isteğe bağlı "diğer" alanından bir seçim yapmasına olanak tanıyan yeni bir soru öğesi ekler. |
addPageBreakItem() | PageBreakItem | Sayfanın başlangıcını işaret eden yeni bir düzen öğesi ekler. |
addParagraphTextItem() | ParagraphTextItem | Katılımcının bir metin bloğu girmesine olanak tanıyan yeni bir soru öğesi ekler. |
addScaleItem() | ScaleItem | Katılımcının radyo düğmelerinden oluşan numaralandırılmış bir dizi arasından bir seçenek belirlemesine olanak tanıyan yeni bir soru öğesi ekler. |
addSectionHeaderItem() | SectionHeaderItem | Bir bölümün başlangıcını görsel olarak belirten yeni bir düzen öğesi ekler. |
addTextItem() | TextItem | Katılımcının tek bir satır metin girmesine olanak tanıyan yeni bir soru öğesi ekler. |
addTimeItem() | TimeItem | Katılımcının günün saatini belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
addVideoItem() | VideoItem | Video görüntüleyen yeni bir düzen öğesi ekler. |
canEditResponse() | Boolean | Formun, gönderdikten sonra bir yanıtı düzenlemek için bağlantı gösterip göstermeyeceğini belirler. |
collectsEmail() | Boolean | Formun, katılımcıların e-posta adreslerini toplayıp toplamadığını belirler. |
createResponse() | FormResponse | Form için yeni bir yanıt oluşturur. |
deleteAllResponses() | Form | Gönderilen tüm yanıtları formun yanıt deposundan siler. |
deleteItem(index) | void | Formdaki tüm öğeler arasından belirli bir dizindeki öğeyi siler. |
deleteItem(item) | void | Belirtilen öğeyi siler. |
deleteResponse(responseId) | Form | Formun yanıt deposundan tek bir yanıtı siler. |
getConfirmationMessage() | String | Formun onay mesajını alır. |
getCustomClosedFormMessage() | String | Form yanıt kabul etmiyorsa görüntülenen özel mesajı veya özel bir mesaj ayarlanmazsa boş bir dize alır. |
getDescription() | String | Formun açıklamasını alır. |
getDestinationId() | String | Formun yanıt hedefinin kimliğini alır. |
getDestinationType() | DestinationType | Formun yanıt hedefinin türünü alır. |
getEditUrl() | String | Formun düzenleme moduna erişmek için kullanılabilecek URL'yi alır. |
getEditors() | User[] | Bu Form için düzenleyenlerin listesini alır. |
getId() | String | Formun kimliğini alır. |
getItemById(id) | Item | Belirli bir kimliğe sahip öğeyi alır. |
getItems() | Item[] | Formdaki tüm öğelerin bir dizisini alır. |
getItems(itemType) | Item[] | Belirli bir türdeki tüm öğelerin dizisini alır. |
getPublishedUrl() | String | Forma yanıt vermek için kullanılabilecek URL'yi alır. |
getResponse(responseId) | FormResponse | Yanıt kimliğine göre tek bir form yanıtı alır. |
getResponses() | FormResponse[] | Formdaki tüm yanıtların bir dizisini alır. |
getResponses(timestamp) | FormResponse[] | Belirli bir tarih ve saatten sonra formun tüm yanıtlarının dizisini alır. |
getShuffleQuestions() | Boolean | Formun her sayfasındaki soruların rastgele düzenlenip sıralanmadığını belirler. |
getSummaryUrl() | String | Form yanıtlarının özetini görüntülemek için kullanılabilecek URL'yi alır. |
getTitle() | String | Formun başlığını alır. |
hasLimitOneResponsePerUser() | Boolean | Formun, katılımcı başına yalnızca bir yanıta izin verilip verilmediğini belirler. |
hasProgressBar() | Boolean | Formun ilerleme çubuğu gösterip göstermeyeceğini belirler. |
hasRespondAgainLink() | Boolean | Bir katılımcı formu doldurduktan sonra formda başka bir yanıt gönderme bağlantısının görüntülenip görüntülenmeyeceğini belirler. |
isAcceptingResponses() | Boolean | Formun şu anda yanıt kabul edip etmediğini belirler. |
isPublishingSummary() | Boolean | Bir katılımcı formu doldurduktan sonra formun, yanıtların özetini görüntülemek için kullanabileceği bir bağlantı gösterip göstermeyeceğini belirler. |
isQuiz() | Boolean | Formun test olup olmadığını belirler. |
moveItem(from, to) | Item | Belirli bir dizindeki bir öğeyi formdaki tüm öğeler arasında belirli bir dizine taşır. |
moveItem(item, toIndex) | Item | Belirli bir öğeyi formdaki tüm öğeler arasında belirli bir dizine taşır. |
removeDestination() | Form | Formun mevcut yanıt hedefiyle bağlantısını kaldırır. |
removeEditor(emailAddress) | Form | Kullanıcıyı, Form düzenleyici listesinden kaldırır. |
removeEditor(user) | Form | Kullanıcıyı, Form düzenleyici listesinden kaldırır. |
requiresLogin() | Boolean | Formun, yanıt verenlerin yanıt vermeden önce aynı alan adında veya alt alan adında yer alan bir hesaba giriş yapmasını gerektirip gerektirmediğini belirler. |
setAcceptingResponses(enabled) | Form | Formun şu anda yanıt kabul edip etmediğini belirler. |
setAllowResponseEdits(enabled) | Form | Formun, gönderdikten sonra yanıtı düzenlemek için bir bağlantı gösterip göstermeyeceğini belirler. |
setCollectEmail(collect) | Form | Formun, katılımcıların e-posta adreslerinin toplanıp toplanmayacağını belirler. |
setConfirmationMessage(message) | Form | Formun onay mesajını ayarlar. |
setCustomClosedFormMessage(message) | Form | Form yanıt kabul etmiyorsa mesajı görüntülenecek şekilde ayarlar. |
setDescription(description) | Form | Formun açıklamasını ayarlar. |
setDestination(type, id) | Form | Form yanıtlarının kaydedileceği hedefi belirler. |
setIsQuiz(enabled) | Form | Formun test olup olmadığını belirler. |
setLimitOneResponsePerUser(enabled) | Form | Formun, katılımcı başına yalnızca bir yanıta izin verilip verilmeyeceğini belirler. |
setProgressBar(enabled) | Form | Formda bir ilerleme çubuğu olup olmadığını belirler. |
setPublishingSummary(enabled) | Form | Bir katılımcı formu gönderdikten sonra yanıtların özetini görüntülemek için formda bir bağlantı görüntülenip görüntülenmeyeceğini belirler. |
setRequireLogin(requireLogin) | Form | Formun, yanıt verenlerin yanıt vermeden önce aynı alan adında veya alt alan adında yer alan bir hesaba giriş yapmasının gerekip gerekmediğini belirler. |
setShowLinkToRespondAgain(enabled) | Form | Bir katılımcı formu tamamladıktan sonra başka bir yanıt göndermek için formda bağlantı gösterilip gösterilmeyeceğini belirler. |
setShuffleQuestions(shuffle) | Form | Formun her sayfasındaki soruların rastgele düzenlenip sıralanmayacağını belirler. |
setTitle(title) | Form | Formun başlığını ayarlar. |
shortenFormUrl(url) | String | Bir formun uzun URL'sini kısa URL'ye dönüştürür. |
submitGrades(responses) | Form | Belirtilen FormResponses için notları gönderir. |
Ayrıntılı belgeler
addCheckboxGridItem()
Yanıt verenin bir dizi onay kutusu arasından satır başına birden çok seçenek belirlemesini sağlayan, sütun ve satırlardan oluşan bir ızgara şeklinde sunulan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a checkbox grid item. const item = form.addCheckboxGridItem(); // Sets the title 'Where did you celebrate New Year's?' item.setTitle('Where did you celebrate New Year's?'); // Sets the grid's rows and columns. item.setRows(['New York', 'San Francisco', 'London']) .setColumns(['2014', '2015', '2016', '2017']);
Return
CheckboxGridItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addCheckboxItem()
Katılımcının bir veya daha fazla onay kutusu seçmesine olanak tanıyan yeni bir soru öğesi ve isteğe bağlı bir "diğer" alanı ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a checkbox item. const item = form.addCheckboxItem(); // Sets the title of the checkbox item to 'Do you prefer cats or dogs?' item.setTitle('Do you prefer cats or dogs?'); // Sets the choices. item.setChoiceValues(['Cats', 'Dogs']);
Return
CheckboxItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addDateItem()
Katılımcının bir tarih belirtmesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a date item. const item = form.addDateItem(); // Sets the title to 'When were you born?' item.setTitle('When were you born?'); // Sets the description for the date item. item.setHelpText('Some helper text.');
Return
DateItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addDateTimeItem()
Katılımcının bir tarih ve saat belirtmesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a question with date and time inputs. const item = form.addDateTimeItem(); // Sets the title to 'When were you born?' item.setTitle('When were you born?'); // Sets the question as required. item.setRequired(true);
Return
DateTimeItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addDurationItem()
Katılımcının bir süre belirtmesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a question with a duration input. const item = form.addDurationItem(); // Sets the title to 'How long can you hold your breath?' item.setTitle('How long can you hold your breath?'); // Sets the question as required. item.setRequired(true);
Return
DurationItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addEditor(emailAddress)
Kullanıcıyı Form
düzenleyici listesine ekler. Kullanıcı zaten görüntüleyen listesindeyse bu yöntem kullanıcıyı görüntüleyen listesinin dışına çıkarır.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
emailAddress | String | Eklenecek kullanıcının e-posta adresi. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addEditor(user)
Kullanıcıyı Form
düzenleyici listesine ekler. Kullanıcı zaten görüntüleyen listesindeyse bu yöntem kullanıcıyı görüntüleyen listesinin dışına çıkarır.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
user | User | Eklenecek kullanıcının temsili. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addEditors(emailAddresses)
Belirtilen kullanıcı dizisini, Form
düzenleyicisi listesine ekler. Kullanıcılardan biri zaten görüntüleyen listesindeyse bu yöntem, söz konusu kullanıcıları görüntüleyen listesinin dışına çıkarır.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
emailAddresses | String[] | Eklenecek kullanıcıların e-posta adresleri dizisi. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addGridItem()
Yanıt verenin bir dizi radyo düğmesinden satır başına bir seçenek belirlemesine olanak tanıyan, bir sütun ve satır ızgarası şeklinde sunulan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a multiple choice grid. const item = form.addGridItem(); // Sets the title to 'Rate your interests.' item.setTitle('Rate your interests'); // Sets the grid's rows and columns. item.setRows(['Cars', 'Computers', 'Celebrities']) .setColumns(['Boring', 'So-so', 'Interesting']);
Return
GridItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addImageItem()
Resim görüntüleyen yeni bir düzen öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds an image item. const item = form.addImageItem(); // Gets the Google icon to use as the image. const img = UrlFetchApp.fetch('https://fonts.gstatic.com/s/i/productlogos/googleg/v6/web-24dp/logo_googleg_color_1x_web_24dp.png'); // Sets the image, title, and description for the item. item.setTitle('Google icon').setHelpText('Google icon').setImage(img);
Return
ImageItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addListItem()
Katılımcının açılır listeden bir seçenek belirlemesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a dropdown list to the form. const item = form.addListItem(); // Sets the title to 'Do you prefer cats or dogs?' item.setTitle('Do you prefer cats or dogs?'); // Sets the description to 'This is description text...' item.setHelpText('This is description text...'); // Creates and adds choices to the dropdown list. item.setChoices([ item.createChoice('dog'), item.createChoice('cat') ]);
Return
ListItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addMultipleChoiceItem()
Katılımcının radyo düğmeleri listesinden veya isteğe bağlı "diğer" alanından bir seçim yapmasına olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a multiple choice item to the form. const item = form.addMultipleChoiceItem(); // Sets the title. item.setTitle('What is your favorite ice cream flavor?'); // Creates some choice items. const vanilla = item.createChoice('vanilla'); const chocolate = item.createChoice('chocolate'); const strawberry = item.createChoice('strawberry'); // Sets the choices. item.setChoices([vanilla, chocolate, strawberry]);
Return
MultipleChoiceItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addPageBreakItem()
Sayfanın başlangıcını işaret eden yeni bir düzen öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds page break items to create a second and third page for the form. const pageTwo = form.addPageBreakItem(); const pageThree = form.addPageBreakItem(); // Sets the titles for the pages. pageTwo.setTitle('Page two'); pageThree.setTitle('Page three'); // Upon completion of the first page, sets the form to navigate to the third page. pageTwo.setGoToPage(pageThree); // Upon completion of the second page, sets the form to navigate back to the first page. pageThree.setGoToPage(FormApp.PageNavigationType.RESTART);
Return
PageBreakItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addParagraphTextItem()
Katılımcının bir metin bloğu girmesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the form by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds the paragraph text item. const item = form.addParagraphTextItem(); // Sets the title to 'What is your address?' item.setTitle('What is your address?');
Return
ParagraphTextItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addScaleItem()
Katılımcının radyo düğmelerinden oluşan numaralandırılmış bir dizi arasından bir seçenek belirlemesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds the scale item. const item = form.addScaleItem(); // Sets the title of the scale item to 'Choose a number.' item.setTitle('Choose a number'); // Sets the scale to 1-5. item.setBounds(1, 5); // Sets the label for the lower and upper bounds. item.setLabels('Lowest', 'Highest');
Return
ScaleItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addSectionHeaderItem()
Bir bölümün başlangıcını görsel olarak belirten yeni bir düzen öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds the section heading item. const item = form.addSectionHeaderItem(); // Sets the title to 'Title of new section.' item.setTitle('Title of new section'); // Sets the description. item.setHelpText('Description of new section');
Return
SectionHeaderItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addTextItem()
Katılımcının tek bir satır metin girmesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a single-line text item. const item = form.addTextItem(); // Sets the title to 'What is your name?' item.setTitle('What is your name?');
Return
TextItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addTimeItem()
Katılımcının günün saatini belirtmesine olanak tanıyan yeni bir soru öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a question with a time input. const item = form.addTimeItem(); // Sets the title to 'What time do you usually wake up in the morning?' item.setTitle('What time do you usually wake up in the morning?');
Return
TimeItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
addVideoItem()
Video görüntüleyen yeni bir düzen öğesi ekler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Adds a video item. const item = form.addVideoItem(); // Sets the title, description, and video. item.setTitle('YouTube video') .setHelpText('Send content automatically via Google Sheets and Apps Script') .setVideoUrl('https://youtu.be/xxgQr-jSu9o'); // Sets the alignment to the center. item.setAlignment(FormApp.Alignment.CENTER);
Return
VideoItem
: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
canEditResponse()
Formun, gönderdikten sonra bir yanıtı düzenlemek için bağlantı gösterip göstermeyeceğini belirler.
FormResponse.getEditResponseUrl()
yöntemi, bu ayardan bağımsız olarak forma düzenleme erişimi olan bir komut dosyası yazarının yanıtı düzenlemek için kullanılabilecek bir URL oluşturmasına olanak tanır.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Checks if the form displays a link to edit a response after submitting it. // The default is false. To let people edit their responses, use // form.setAllowResponseEdits(true). const edit = form.canEditResponse(); // If the form doesn't let people edit responses, logs false to the console. console.log(edit);
Return
Boolean
— Formda "Yanıtınızı düzenleyin" bağlantısı görüntüleniyorsa true
; görünmüyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
collectsEmail()
Formun, katılımcıların e-posta adreslerini toplayıp toplamadığını belirler.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form to not collect respondents' email addresses. form.setCollectEmail(false); // Checks whether the form collects respondents' email addresses and logs it to the console. const bool = form.collectsEmail(); console.log(bool);
Return
Boolean
— Form e-posta adreslerini topluyorsa true
, toplamıyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
createResponse()
Form için yeni bir yanıt oluşturur. Bir soru öğesini yanıtlamak için öğeden bir ItemResponse
oluşturun, ardından FormResponse.withItemResponse(response)
yöntemini çağırarak öğeyi bu form yanıtına ekleyin. Oluşturulan yanıtı kaydetmek için FormResponse.submit()
çağrısı yapın.
Return
FormResponse
: Yeni oluşturulan form yanıtı.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
deleteAllResponses()
Gönderilen tüm yanıtları formun yanıt deposundan siler. Bu yöntem, harici bir yanıt hedefinde (e-tablo gibi) depolanan yanıtların kopyalarını silmez ancak formun özet görünümünü temizler.
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
deleteItem(index)
Formdaki tüm öğeler arasından belirli bir dizindeki öğeyi siler. Belirtilen dizinde hiçbir öğe yoksa bir komut dosyası istisnası atar.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets all the items from the form. const items = form.getItems(); // Finds the index of a paragraph text item and deletes it by the item's index. const index = items.findIndex(item => item.getType() === FormApp.ItemType.PARAGRAPH_TEXT); if (index !== -1) { form.deleteItem(index); }
Parametreler
Ad | Tür | Açıklama |
---|---|---|
index | Integer | Formdaki tüm öğeler arasında öğenin dizini. |
Dekoratif yastıklar
Error
: Belirtilen dizinde hiçbir öğe yoksa
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
deleteItem(item)
Belirtilen öğeyi siler. Öğe silinmişse bir komut dosyası istisnası oluşturur.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets all of the items from the form. const items = form.getItems(); // Finds a paragraph text item and deletes it. const item = items.find(item => item.getType() === FormApp.ItemType.PARAGRAPH_TEXT); if (item) { form.deleteItem(item); }
Parametreler
Ad | Tür | Açıklama |
---|---|---|
item | Item | Silinecek öğe. |
Dekoratif yastıklar
Error
: Öğe formda yoksa
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
deleteResponse(responseId)
Formun yanıt deposundan tek bir yanıtı siler. Bu yöntem, harici bir yanıt hedefinde (e-tablo gibi) depolanan yanıtların kopyalarını silmez ancak formun özet görünümünden yanıtı kaldırır. Yanıt kimliği FormResponse.getId()
ile alınabilir.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
responseId | String | Silinecek form yanıtının kimliği. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getConfirmationMessage()
Formun onay mesajını alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the confirmation message to display after someone submits the form. form.setConfirmationMessage('You successfully submitted the form.'); // Gets the confirmation message and logs it to the console. const message = form.getConfirmationMessage(); console.log(message);
Return
String
: Formun onay mesajı.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getCustomClosedFormMessage()
Form yanıt kabul etmiyorsa görüntülenen özel mesajı veya özel bir mesaj ayarlanmazsa boş bir dize alır.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets a custom closed form message to display to the user when the form // no longer accepts responses. form.setCustomClosedFormMessage('The form is no longer accepting responses.'); // Gets the custom message set for the form and logs it to the console. const message = form.getCustomClosedFormMessage(); console.log(message);
Return
String
: Form yanıt kabul etmiyorsa görüntülenecek özel mesaj veya özel bir mesaj ayarlanmamışsa boş bir dize.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getDescription()
Formun açıklamasını alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form description. form.setDescription('This is the form description.'); // Gets the form description and logs it to the console. const description = form.getDescription(); console.log(description);
Return
String
: Formun açıklaması.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getDestinationId()
Formun yanıt hedefinin kimliğini alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Creates a spreadsheet to use as the response destination. const ss = SpreadsheetApp.create('Test_Spreadsheet'); // Updates the form's response destination. form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId()); // Gets the ID of the form's response destination and logs it to the console. const destinationId = form.getDestinationId(); console.log(destinationId);
Return
String
: Formun yanıt hedefinin kimliği.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getDestinationType()
Formun yanıt hedefinin türünü alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc1234556/edit'); // Gets the type of the form's response destination and logs it to the console. const destinationType = form.getDestinationType().name(); console.log(destinationType);
Return
DestinationType
: Formun yanıt hedefinin türü.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getEditUrl()
Formun düzenleme moduna erişmek için kullanılabilecek URL'yi alır.
// Opens the form by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the URL that accesses the form's edit mode and logs it to the console. const url = form.getEditUrl(); console.log(url);
Return
String
: Formun düzenleneceği URL.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getEditors()
Bu Form
için düzenleyenlerin listesini alır.
Return
User[]
: Düzenleme iznine sahip olan kullanıcı dizisi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getId()
Formun kimliğini alır.
// Opens the form by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the ID of the form and logs it to the console. const id = form.getId(); console.log(id);
Return
String
: Formun kimliği.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getItemById(id)
Belirli bir kimliğe sahip öğeyi alır. Kimlik, formdaki bir öğeye karşılık gelmiyorsa null
değerini döndürür.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the ID of the first item on the form. const itemId = form.getItems()[0].getId(); // Gets the item from the ID. const item = form.getItemById(itemId); // Gets the name of the item type and logs it to the console. const type = item.getType().name(); console.log(type);
Parametreler
Ad | Tür | Açıklama |
---|---|---|
id | Integer | Öğenin kimliği. |
Return
Item
: Belirtilen kimliğe sahip öğe veya öğe formda yoksa null
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getItems()
Formdaki tüm öğelerin bir dizisini alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the list of items in the form. const items = form.getItems(); // Gets the type for each item and logs them to the console. const types = items.map((item) => item.getType().name()); console.log(types);
Return
Item[]
: Formdaki tüm öğelerin dizisi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getItems(itemType)
Belirli bir türdeki tüm öğelerin dizisini alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets a list of all checkbox items on the form. const items = form.getItems(FormApp.ItemType.CHECKBOX); // Gets the title of each checkbox item and logs them to the console. const checkboxItemsTitle = items.map((item) => item.asCheckboxItem().getTitle()); console.log(checkboxItemsTitle);
Parametreler
Ad | Tür | Açıklama |
---|---|---|
itemType | ItemType | Alınacak öğelerin türü. |
Return
Item[]
: Söz konusu türdeki tüm öğeleri içeren dizi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getPublishedUrl()
Forma yanıt vermek için kullanılabilecek URL'yi alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the URL to respond to the form and logs it to the console. const url = form.getPublishedUrl(); console.log(url);
Return
String
: Forma yanıt verecek URL'yi belirtir.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getResponse(responseId)
Yanıt kimliğine göre tek bir form yanıtı alır. Yanıt kimlikleri FormResponse.getId()
adresinden alınabilir.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
responseId | String | Form yanıtının kimliği. |
Return
FormResponse
: Form yanıtı.
Dekoratif yastıklar
Error
- Yanıt mevcut değilse
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getResponses()
Formdaki tüm yanıtların bir dizisini alır.
Return
FormResponse[]
: Forma verilen tüm yanıtların dizisi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getResponses(timestamp)
Belirli bir tarih ve saatten sonra formun tüm yanıtlarının dizisini alır.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
timestamp | Date | Form yanıtlarının döndürülmesi gereken en erken tarih ve saat. |
Return
FormResponse[]
: Form yanıtlarının listesi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getShuffleQuestions()
Formun her sayfasındaki soruların rastgele düzenlenip sıralanmadığını belirler.
Return
Boolean
— Formun her sayfasındaki soruların sırası rastgeleyse true
; değilse false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getSummaryUrl()
Form yanıtlarının özetini görüntülemek için kullanılabilecek URL'yi alır. setPublishingSummary(enabled)
, true
olarak ayarlanmadığı sürece yalnızca form için düzenleme izni olan kullanıcılar URL'ye erişebilir.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // Opens the form by its URL. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the URL to view a summary of the form's responses and logs it to the console. const url = form.getSummaryUrl(); console.log(url);
Return
String
: Yanıtların özetinin görüntüleneceği URL.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getTitle()
Formun başlığını alır.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the title of the form to 'For_Testing.' form.setTitle('For_Testing'); // Gets the title of the form and logs it to the console. const title = form.getTitle(); console.log(title);
Return
String
: Formun başlığı.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
hasLimitOneResponsePerUser()
Formun, katılımcı başına yalnızca bir yanıta izin verilip verilmediğini belirler. Değer true
ise komut dosyası hiç form yanıtı gönderemez.
Return
Boolean
— Formda katılımcı başına yalnızca bir yanıta izin veriliyorsa true
; izin verilmiyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
hasProgressBar()
Formun ilerleme çubuğu gösterip göstermeyeceğini belirler.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // Opens the form by its URL. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Displays the progress bar on the form. form.setProgressBar(true); // Checks if the form displays a progress bar and logs it to the console. console.log(form.hasProgressBar());
Return
Boolean
— Formda ilerleme çubuğu görüntüleniyorsa true
, görünmüyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
hasRespondAgainLink()
Bir katılımcı formu doldurduktan sonra formda başka bir yanıt gönderme bağlantısının görüntülenip görüntülenmeyeceğini belirler.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form to display a link to submit another // response after someone submits the form. form.setShowLinkToRespondAgain(true); // Checks if the form displays a 'Submit another response' link and logs it to the console. console.log(form.hasRespondAgainLink());
Return
Boolean
— Formda "Başka bir yanıt gönder" bağlantısı görüntüleniyorsa true
; görünmüyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
isAcceptingResponses()
Formun şu anda yanıt kabul edip etmediğini belirler.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form to accept responses. form.setAcceptingResponses(true); // Checks if the form is accepting responses or not and logs it to the console. const accepting = form.isAcceptingResponses(); console.log(accepting);
Return
Boolean
— Form yanıt kabul ediyorsa true
; kabul etmiyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
isPublishingSummary()
Bir katılımcı formu doldurduktan sonra formun, yanıtların özetini görüntülemek için kullanabileceği bir bağlantı gösterip göstermeyeceğini belirler.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form to display a link to a summary of // the responses after someone submits the form. form.setPublishingSummary(true); // Checks if the form displays a "See previous responses" link and logs it to the console. const publishingLink = form.isPublishingSummary(); console.log(publishingLink);
Return
Boolean
— Formda "Önceki yanıtları göster" bağlantısı görüntüleniyorsa true
; görüntülenmiyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
isQuiz()
Formun test olup olmadığını belirler.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form as a quiz. form.setIsQuiz(true); // Checks if the form is a quiz or not and logs it to the console. console.log(form.isQuiz());
Return
Boolean
— Form yanıt kabul ediyorsa true
; kabul etmiyorsa false
.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
moveItem(from, to)
Belirli bir dizindeki bir öğeyi formdaki tüm öğeler arasında belirli bir dizine taşır. to
dizini sınırların dışındaysa komut dosyası istisnası oluşturur.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Moves the first item to be the last item. form.moveItem(0, form.getItems().length - 1);
Parametreler
Ad | Tür | Açıklama |
---|---|---|
from | Integer | Formdaki tüm öğeler arasında öğenin geçerli dizini. |
to | Integer | Formdaki tüm öğeler arasında öğenin yeni dizini. |
Return
Item
: Taşınan öğe.
Dekoratif yastıklar
Error
: İki dizin de sınırların dışındaysa.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
moveItem(item, toIndex)
Belirli bir öğeyi formdaki tüm öğeler arasında belirli bir dizine taşır. Belirtilen dizin sınırların dışındaysa komut dosyası istisnasını atar.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the first item. const item = form.getItems()[0]; // Moves the item to be the last item. form.moveItem(item, form.getItems().length - 1);
Parametreler
Ad | Tür | Açıklama |
---|---|---|
item | Item | Taşınacak öğe. |
toIndex | Integer | Formdaki tüm öğeler arasında öğenin yeni dizini. |
Return
Item
: Taşınan öğe.
Dekoratif yastıklar
Error
: Dizin sınırların dışındaysa.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
removeDestination()
Formun mevcut yanıt hedefiyle bağlantısını kaldırır. Bağlantısı kaldırılan eski hedef, önceki tüm yanıtların bir kopyasını saklar. Açıkça ayarlanmış bir hedefi olmayanlar da dahil olmak üzere tüm formlar, formun yanıt deposuna bir yanıt kopyasını kaydeder. Formun şu anda bir yanıt hedefi yoksa bu yöntemin herhangi bir etkisi olmaz.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Opens a spreadsheet to use for the response destination. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123456/edit'); // Updates the form's response destination to the spreadsheet. form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId()); // Unlinks the form from the spreadsheet. form.removeDestination();
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
removeEditor(emailAddress)
Kullanıcıyı, Form
düzenleyici listesinden kaldırır. Genel erişime sahip bir kullanıcı sınıfına ait olan (örneğin, Form
, kullanıcının tüm alan adıyla paylaşılıyorsa veya Form
, kullanıcının erişebildiği bir ortak Drive'da yer alıyorsa) bu yöntem, kullanıcıların Form
ürününe erişmesini engellemez.
Bu işlem, Drive dosyalarını görüntüleyenler listesinden de kaldırır.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
emailAddress | String | Kaldırılacak kullanıcının e-posta adresi. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
removeEditor(user)
Kullanıcıyı, Form
düzenleyici listesinden kaldırır. Genel erişime sahip bir kullanıcı sınıfına ait olan (örneğin, Form
, kullanıcının tüm alan adıyla paylaşılıyorsa veya Form
, kullanıcının erişebildiği bir ortak Drive'da yer alıyorsa) bu yöntem, kullanıcıların Form
ürününe erişmesini engellemez.
Bu işlem, Drive dosyalarını görüntüleyenler listesinden de kaldırır.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
user | User | Kaldırılacak kullanıcının temsili. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
requiresLogin()
Formun, yanıt verenlerin yanıt vermeden önce aynı alan adında veya alt alan adında yer alan bir hesaba giriş yapmasını gerektirip gerektirmediğini belirler.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Checks if the form requires respondents to log in to a Google Workspace account // before responding and logs it to the console. const login = form.requiresLogin(); console.log(login);
Return
Boolean
— Form, kullanıcıların giriş yapmasını gerektiriyorsa true
; zorunlu değilse false
.
setAcceptingResponses(enabled)
Formun şu anda yanıt kabul edip etmediğini belirler. Yeni formlar için varsayılan değer true
.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form to accept responses. form.setAcceptingResponses(true); // Checks whether the form is accepting responses or not and logs it to the console. console.log(form.isAcceptingResponses());
Parametreler
Ad | Tür | Açıklama |
---|---|---|
enabled | Boolean | Form yanıt kabul ediyorsa true ; kabul etmemesi gerekiyorsa false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setAllowResponseEdits(enabled)
Formun, gönderdikten sonra yanıtı düzenlemek için bir bağlantı gösterip göstermeyeceğini belirler. Yeni formlar için varsayılan ayar false
.
FormResponse.getEditResponseUrl()
yöntemi, bu ayardan bağımsız olarak form için düzenleme iznine sahip bir komut dosyası yazarının yanıtı düzenlemek için kullanılabilecek bir URL oluşturmasına olanak tanır.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Shows "Edit your response" link after someone submits the form. form.setAllowResponseEdits(true); // Checks whether the option to edit the form after a user submits it is set to true or not // and logs it to the console. console.log(form.canEditResponse());
Parametreler
Ad | Tür | Açıklama |
---|---|---|
enabled | Boolean | Formda "Yanıtınızı düzenleyin" bağlantısı gösterilmesi gerekiyorsa true ; görünmüyorsa false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setCollectEmail(collect)
Formun, katılımcıların e-posta adreslerinin toplanıp toplanmayacağını belirler. Yeni formlar için varsayılan ayar
false
.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form to collect respondents' email addresses. form.setCollectEmail(true); // Checks whether the value is set to true or false and logs it to the console. const collect = form.collectsEmail(); console.log(collect);
Parametreler
Ad | Tür | Açıklama |
---|---|---|
collect | Boolean | Form, e-posta adreslerini toplayacaksa true , toplamıyorsa false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setConfirmationMessage(message)
Formun onay mesajını ayarlar.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets a custom confirmation message to display after someone submits the form. form.setConfirmationMessage('Your form has been successfully submitted.'); // Gets the confirmation message set for the form and logs it to the console. const message = form.getConfirmationMessage(); console.log(message);
Parametreler
Ad | Tür | Açıklama |
---|---|---|
message | String | Formun yeni onay mesajı. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setCustomClosedFormMessage(message)
Form yanıt kabul etmiyorsa mesajı görüntülenecek şekilde ayarlar. Herhangi bir mesaj ayarlanmazsa form, varsayılan bir mesaj kullanır.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form to not accept responses. form.setAcceptingResponses(false); // Sets a custom closed form message to display to the user. form.setCustomClosedFormMessage('The form is no longer accepting responses.'); // Gets the custom message set for the form and logs it to the console. const message = form.getCustomClosedFormMessage(); console.log(message);
Parametreler
Ad | Tür | Açıklama |
---|---|---|
message | String | Form yanıt kabul etmiyorsa görüntülenecek mesaj. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setDescription(description)
Formun açıklamasını ayarlar.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
description | String | Formun yeni açıklaması. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setDestination(type, id)
Form yanıtlarının kaydedileceği hedefi belirler. Açıkça ayarlanmış bir hedefi olmayanlar da dahil olmak üzere tüm formlar, formun yanıt deposuna yanıtların bir kopyasını kaydeder.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
type | DestinationType | Formun yanıt hedefinin türü. |
id | String | Formun yanıt hedefinin kimliği. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Dekoratif yastıklar
Error
: Belirtilen hedef kimliği geçersizse
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setIsQuiz(enabled)
Formun test olup olmadığını belirler. Yeni formlar için varsayılan değer false
.
Not verilen sorulara yalnızca Testler'de izin verilir. Bu nedenle, bunun false
olarak ayarlanması tüm not verme seçeneklerinin tüm sorulardan kaldırılmasına neden olur.
Test ayarları yalnızca yeni Formlar kullanıcı arayüzünde kullanılabilir. Bir formu Test yapmak için yeni kullanıcı arayüzü kullanılır.
// Opens the Forms file by its URL. If you created your script from within a // Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Makes the form a quiz. form.setIsQuiz(true); // Checks whether the form is a quiz or not and logs it to the console. console.log(form.isQuiz());
Parametreler
Ad | Tür | Açıklama |
---|---|---|
enabled | Boolean | Form için test özelliklerinin etkinleştirilmesi gerekiyorsa true ; etkinleştirilmemişse false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setLimitOneResponsePerUser(enabled)
Formun, katılımcı başına yalnızca bir yanıta izin verilip verilmeyeceğini belirler. Yeni formlar için varsayılan ayar
false
. Değer true
olarak ayarlanırsa komut dosyası hiç form yanıtı gönderemez.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
enabled | Boolean | Formda, yanıt veren başına yalnızca bir yanıt verilmesi gerekiyorsa true , izin verilmiyorsa false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setProgressBar(enabled)
Formda bir ilerleme çubuğu olup olmadığını belirler. Yeni formlar için varsayılan değer false
.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Displays the progress bar on the form. form.setProgressBar(true); // Checks whether the form has a progress bar and logs it to the console. console.log(form.hasProgressBar());
Parametreler
Ad | Tür | Açıklama |
---|---|---|
enabled | Boolean | Formda bir ilerleme çubuğu görüntüleniyorsa true ; görünmüyorsa false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setPublishingSummary(enabled)
Bir katılımcı formu gönderdikten sonra yanıtların özetini görüntülemek için formda bir bağlantı görüntülenip görüntülenmeyeceğini belirler. Yeni formlar için varsayılan değer false
.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
enabled | Boolean | true , formda "Önceki yanıtları göster" bağlantısı görüntülenmesi gerekiyorsa false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setRequireLogin(requireLogin)
Formun, yanıt verenlerin yanıt vermeden önce aynı alan adında veya alt alan adında yer alan bir hesaba giriş yapmasının gerekip gerekmediğini belirler. Bir alan yöneticisi varsayılanı değiştirmediği sürece yeni formlar için varsayılan değer false
şeklindedir.
Bu özellik yalnızca Google Workspace kullanıcıları tarafından oluşturulan formlarda kullanılabilir. Diğer Google hesabı türlerinin kullanıcılarının giriş yapması gerekmez.
// Opens the Forms file by its URL. If you created your script from within // a Google Forms file, you can use FormApp.getActiveForm() instead. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Sets the form so that users must log in to their Google Workspace account. form.setRequireLogin(true); // Checks whether the form requires login or not and logs it to the console. console.log(form.requiresLogin());
Parametreler
Ad | Tür | Açıklama |
---|---|---|
requireLogin | Boolean | Form, kullanıcıların giriş yapmasını gerektiriyorsa true , gerekmiyorsa false . |
Return
Form
: Geçerli biçim (zincirleme için).
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setShowLinkToRespondAgain(enabled)
Bir katılımcı formu tamamladıktan sonra başka bir yanıt göndermek için formda bağlantı gösterilip gösterilmeyeceğini belirler. Yeni formlar için varsayılan değer true
.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
enabled | Boolean | true , formda "Başka bir yanıt gönder" bağlantısı gösterilmesi gerekiyorsa false . |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setShuffleQuestions(shuffle)
Formun her sayfasındaki soruların rastgele düzenlenip sıralanmayacağını belirler.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
shuffle | Boolean | true Formun her bir sayfasındaki soruların sırasının rastgele
olması gerekiyorsa; false değilse. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setTitle(title)
Formun başlığını ayarlar.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
title | String | Formun yeni başlığı. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
shortenFormUrl(url)
Bir formun uzun URL'sini kısa URL'ye dönüştürür. Uzun URL Google Formlar'a ait değilse istisna oluşturur.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
url | String | Kısaltılacak URL. |
Return
String
— http://goo.gl/forms/1234
biçiminde bir URL.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
submitGrades(responses)
Belirtilen FormResponses için notları gönderir.
Kodunuz bir onFormSubmit
tetikleyicisi içeriyorsa submitGrades()
çağrısı, onFormSubmit
koşulunu tetikler ve sonsuz döngüye neden olur. Sonsuz döngüyü önlemek için submitGrades()
yöntemini çağırmadan önce notların mevcut olup olmadığını kontrol eden bir kod ekleyin.
Parametreler
Ad | Tür | Açıklama |
---|---|---|
responses | FormResponse[] | Formun tüm yanıtlarının dizisi. |
Return
Form
— Bu Form
, zincirleme bağlantı için.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamların biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms