Genel özellikleri ve öğeleri içeren bir form. Başlık, ayarlar ve yanıtların depolandığı yer gibi özellikler bulunur. Öğeler arasında onay kutuları veya radyo düğmeleri gibi soru öğeleri yer alırken düzen öğeleri arasında sayfa sonları gibi şeyler bulunur. Formlara Form üzerinden erişilebilir veya formlar oluşturulabilir.
// Open a form by ID and create a new spreadsheet. const form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); const 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 |
|---|---|---|
add | Checkbox | Yanıtlayanın bir dizi onay kutusundan satır başına birden fazla seçenek belirlemesine olanak tanıyan, sütun ve satır tablosu olarak sunulan yeni bir soru öğesi ekler. |
add | Checkbox | 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. |
add | Date | Yanıtlayanın bir tarih belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Date | Katılımcının tarih ve saat belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Duration | Katılımcının bir zaman uzunluğunu belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Form | Belirtilen kullanıcıyı Form için düzenleyenler listesine ekler. |
add | Form | Belirtilen kullanıcıyı Form için düzenleyenler listesine ekler. |
add | Form | Belirtilen kullanıcı dizisini Form için düzenleyenler listesine ekler. |
add | Grid | Yanıtlayanın bir radyo düğmesi dizisinden satır başına bir seçenek belirlemesine olanak tanıyan, sütun ve satır tablosu olarak sunulan yeni bir soru öğesi ekler. |
add | Image | Resim gösteren yeni bir düzen öğesi ekler. |
add | List | Katılımcının açılır listeden bir seçenek belirlemesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Multiple | Katılımcının radyo düğmeleri listesinden bir seçenek veya isteğe bağlı "diğer" alanını seçmesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Page | Sayfanın başlangıcını işaretleyen yeni bir düzen öğesi ekler. |
add | Paragraph | Katılımcının bir metin bloğu girmesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Form | Belirtilen kullanıcıyı Form için yanıt verenler listesine ekler. |
add | Form | Belirtilen kullanıcıyı Form için yanıt verenler listesine ekler. |
add | Form | Belirtilen kullanıcı dizisini Form için yanıt verenler listesine ekler. |
add | Rating | Yanıtlayanın puan vermesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Scale | Katılımcının numaralandırılmış bir radyo düğmesi dizisinden bir seçenek belirlemesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Section | Bir bölümün başlangıcını görsel olarak belirten yeni bir düzen öğesi ekler. |
add | Text | Yanıtlayanın tek bir metin satırı girmesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Time | Yanıtlayanın günün saatini belirtmesine olanak tanıyan yeni bir soru öğesi ekler. |
add | Video | Video gösteren yeni bir düzen öğesi ekler. |
can | Boolean | Formun, gönderildikten sonra yanıtı düzenleme bağlantısı gösterip göstermeyeceğini belirler. |
collects | Boolean | Formun, katılımcıların e-posta adreslerini toplayıp toplamayacağını belirler. |
create | Form | Forma yeni bir yanıt oluşturur. |
delete | Form | Gönderilen tüm yanıtları formun yanıt deposundan siler. |
delete | void | Formdaki tüm öğeler arasında belirli bir dizindeki öğeyi siler. |
delete | void | Belirtilen öğeyi siler. |
delete | Form | Formun yanıt deposundan tek bir yanıtı siler. |
get | String | Formun onay mesajını alır. |
get | String | Form yanıt kabul etmiyorsa görüntülenen özel mesajı veya özel mesaj ayarlanmamışsa boş dizeyi alır. |
get | String | Formun açıklamasını alır. |
get | String | Formun yanıt hedefinin kimliğini alır. |
get | Destination | Formun yanıt hedefinin türünü alır. |
get | String | Formun düzenleme moduna erişmek için kullanılabilecek URL'yi alır. |
get | User[] | Bu Form için düzenleyenlerin listesini alır. |
get | String | Formun kimliğini alır. |
get | Item|null | Belirli bir kimliğe sahip öğeyi alır. |
get | Item[] | Formdaki tüm öğelerin dizisini alır. |
get | Item[] | Belirli bir türdeki tüm öğelerin dizisini alır. |
get | User[] | Bu Form için yanıt verenlerin listesini alır. |
get | String | Forma yanıt vermek için kullanılabilecek URL'yi alır. |
get | Form | Yanıt kimliğine göre tek bir form yanıtı alır. |
get | Form | Formun tüm yanıtlarının dizisini alır. |
get | Form | Belirli bir tarih ve saatten sonraki tüm form yanıtlarının dizisini alır. |
get | Boolean | Formun her sayfasındaki soruların sırasının rastgele olup olmayacağını belirler. |
get | String | Form yanıtlarının özetini görüntülemek için kullanılabilecek URL'yi alır. |
get | String | Formun başlığını alır. |
has | Boolean | Formun, katılımcı başına yalnızca bir yanıta izin verip vermeyeceğini belirler. |
has | Boolean | Formda ilerleme çubuğu gösterilip gösterilmeyeceğini belirler. |
has | Boolean | Formu yanıtlayan kişi formu tamamladıktan sonra formda başka bir yanıt gönderme bağlantısının gösterilip gösterilmeyeceğini belirler. |
is | Boolean | Formun şu anda yanıt kabul edip etmediğini belirler. |
is | Boolean | Formun yayınlanıp yayınlanmadığını belirler. |
is | Boolean | Formu dolduran bir katılımcıdan sonra formda yanıtların özetini görüntüleme bağlantısının gösterilip gösterilmeyeceğini belirler. |
is | Boolean | Formun test olup olmadığını belirler. |
move | Item | Formdaki tüm öğeler arasında belirli bir dizindeki bir öğeyi başka bir dizine taşır. |
move | Item | Belirli bir öğeyi formdaki tüm öğeler arasında belirli bir dizine taşır. |
remove | Form | Formun mevcut yanıt hedefiyle bağlantısını kaldırır. |
remove | Form | Belirtilen kullanıcıyı Form için düzenleyenler listesinden kaldırır. |
remove | Form | Belirtilen kullanıcıyı Form için düzenleyenler listesinden kaldırır. |
remove | Form | Belirtilen kullanıcıyı Form için yanıt verenler listesinden kaldırır. |
remove | Form | Belirtilen kullanıcıyı Form için yanıt verenler listesinden kaldırır. |
set | Form | Formun şu anda yanıt kabul edip etmediğini ayarlar. |
set | Form | Formun, gönderildikten sonra yanıtı düzenleme bağlantısı gösterip göstermeyeceğini ayarlar. |
set | Form | Formun, katılımcıların e-posta adreslerini toplayıp toplamayacağını belirler. |
set | Form | Formun onay mesajını ayarlar. |
set | Form | Form yanıt kabul etmiyorsa gösterilecek mesajı ayarlar. |
set | Form | Formun açıklamasını ayarlar. |
set | Form | Form yanıtlarının kaydedileceği hedefi belirler. |
set | Form | Formun test olup olmadığını ayarlar. |
set | Form | Formun, yanıtlayan başına yalnızca bir yanıta izin verip vermeyeceğini ayarlar. |
set | Form | Formda ilerleme çubuğu olup olmayacağını ayarlar. |
set | Form | Formun yayınlanıp yayınlanmayacağını ayarlar. |
set | Form | Yanıtlayan formu gönderdikten sonra formda yanıtların özetini görüntüleme bağlantısının gösterilip gösterilmeyeceğini ayarlar. |
set | Form | Yanıtlayan formu tamamladıktan sonra formda başka bir yanıt gönderme bağlantısının gösterilip gösterilmeyeceğini ayarlar. |
set | Form | Formun her sayfasındaki soruların sırasının rastgele belirlenip belirlenmeyeceğini ayarlar. |
set | Form | Formun başlığını ayarlar. |
shorten | String | Bir formun uzun URL'sini kısa URL'ye dönüştürür. |
submit | Form | Belirli FormYanıtları için notları gönderir. |
supports | Boolean | Formun yayınlamayı destekleyip desteklemediğini belirler. |
Ayrıntılı belgeler
add Checkbox Grid Item()
Yanıtlayanın bir dizi onay kutusundan satır başına birden fazla seçenek belirlemesine olanak tanıyan, sütun ve satır tablosu olarak 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(); 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
Checkbox: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Checkbox Item()
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
Checkbox: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Date Item()
Yanıtlayanı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
Date: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Date Time Item()
Katılımcının 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
Date: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Duration Item()
Katılımcının bir zaman uzunluğunu 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
Duration: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Editor(emailAddress)
Belirtilen kullanıcıyı Form için düzenleyenler listesine ekler. Kullanıcı zaten izleyiciler veya yanıt verenler listesindeyse bu yöntem, kullanıcının listeden çıkarılmasını sağlar.
// 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 editor to the form. // TODO(developer): replace the emailAddress. form.addEditor('editor@uni.edu');
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
email | String | Eklenecek kullanıcının e-posta adresi. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Editor(user)
Belirtilen kullanıcıyı Form için düzenleyenler listesine ekler. Kullanıcı zaten izleyiciler veya yanıt verenler listesindeyse bu yöntem, kullanıcının listeden çıkarılmasını sağlar.
// Opens the Forms file by its URL. // TODO(developer): Replace the URL with your own. const oldForm = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the editors from the old form. const users = oldForm.getEditors(); // Creates a new form. const newForm = FormApp.create('New form'); // Adds the editors to a new form. users.forEach(user => newForm.addEditor(user));
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
user | User | Eklenecek kullanıcının temsili. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Editors(emailAddresses)
Belirtilen kullanıcı dizisini Form için düzenleyenler listesine ekler. Kullanıcılardan herhangi biri zaten izleyiciler listesindeyse bu yöntem, söz konusu kullanıcıları izleyiciler listesinden çıkarı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'); // Adds editors to the form. // TODO(developer): replace the emailAddress. form.addPublishedReaders(['editor1@uni.edu', 'editor2@uni.edu']);
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
email | String[] | Eklenecek kullanıcıların e-posta adreslerinden oluşan bir dizi. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Grid Item()
Yanıtlayanın bir radyo düğmesi dizisinden satır başına bir seçenek belirlemesine olanak tanıyan, sütun ve satır tablosu olarak 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
Grid: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Image Item()
Resim gösteren 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
Image: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add List Item()
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
List: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Multiple Choice Item()
Katılımcının radyo düğmeleri listesinden bir seçenek veya isteğe bağlı "diğer" alanını seçmesine 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
Multiple: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Page Break Item()
Sayfanın başlangıcını işaretleyen 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
Page: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Paragraph Text Item()
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
Paragraph: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Published Reader(emailAddress)
Belirtilen kullanıcıyı Form için yanıt verenler listesine ekler. Kullanıcı zaten düzenleyenler veya görüntüleyenler listesindeyse bu yöntemin 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'); // Adds responder to the form. // TODO(developer): replace the emailAddress. form.addPublishedReader('responder@uni.edu');
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
email | String | Eklenecek kullanıcının e-posta adresi. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Published Reader(user)
Belirtilen kullanıcıyı Form için yanıt verenler listesine ekler. Kullanıcı zaten düzenleyenler veya görüntüleyenler listesindeyse bu yöntemin etkisi olmaz.
// Opens the Forms file by its URL. // TODO(developer): Replace the URL with your own. const oldForm = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the responders from the old form. const users = oldForm.getPublishedReaders(); // Creates a new form. const newForm = FormApp.create('New form'); // Adds the responders to a new form. users.forEach(user => newForm.addPublishedReader(user));
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
user | User | Eklenecek kullanıcının temsili. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Published Readers(emailAddresses)
Belirtilen kullanıcı dizisini Form için yanıt verenler listesine ekler. Kullanıcı zaten düzenleyenler veya görüntüleyenler listesindeyse bu yöntemin 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'); // Adds responders to the form. // TODO(developer): replace the emailAddress. form.addPublishedReaders(['responder1@uni.edu', 'responder2@uni.edu']);
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
email | String[] | Eklenecek kullanıcıların e-posta adreslerinden oluşan bir dizi. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Rating Item()
Yanıtlayanın puan vermesine 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 rating item. const item = form.addRatingItem();
Return
Rating: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Scale Item()
Katılımcının numaralandırılmış bir radyo düğmesi dizisinden 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
Scale: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Section Header Item()
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
Section: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Text Item()
Yanıtlayanın tek bir metin satırı 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
Text: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Time Item()
Yanıtlayanı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
Time: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
add Video Item()
Video gösteren 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
Video: Yeni oluşturulan öğe.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
can Edit Response()
Formun, gönderildikten sonra yanıtı düzenleme bağlantısı gösterip göstermeyeceğini belirler.
Bu ayardan bağımsız olarak Form yöntemi, 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
Formda "Yanıtınızı düzenleyin" bağlantısı gösteriliyorsa Boolean, gösterilmiyorsa false.true
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
collects Email()
Formun, katılımcıların e-posta adreslerini toplayıp toplamayacağı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
Form e-posta adreslerini topluyorsa Boolean, toplamıyorsa true.false
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
create Response()
Forma yeni bir yanıt oluşturur. Bir soru öğesini yanıtlamak için öğeden Item oluşturun, ardından Form işlevini çağırarak bu form yanıtına ekleyin. Oluşturulan yanıtı kaydetmek için Form'ı arayın.
Return
Form: Yeni oluşturulan form yanıtı.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
delete All Responses()
Gönderilen tüm yanıtları formun yanıt deposundan siler. Bu yöntem, yanıtların harici bir yanıt hedefinde (ör. e-tablo) depolanan kopyalarını silmez ancak formun özet görünümünü temizler.
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
delete Item(index)
Formdaki tüm öğeler arasında belirli bir dizindeki öğeyi siler. Belirtilen dizinde öğe yoksa komut dosyası oluşturma 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 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. |
Verdiği hatalar
Error: Belirtilen dizinde öğe yoksa
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
delete Item(item)
Belirtilen öğeyi siler. Öğe zaten silinmişse bir komut dosyası oluşturma 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. |
Verdiği hatalar
Error: Öğe formda yoksa
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
delete Response(responseId)
Formun yanıt deposundan tek bir yanıtı siler. Bu yöntem, yanıtların harici bir yanıt hedefinde (ör. e-tablo) saklanan kopyalarını silmez ancak yanıtı formun özet görünümünden kaldırır. Yanıt kimliği, Form ile alınabilir.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
response | String | Silinecek form yanıtının kimliği. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Confirmation Message()
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 kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Custom Closed Form Message()
Form yanıt kabul etmiyorsa görüntülenen özel mesajı veya özel mesaj ayarlanmamışsa boş dizeyi 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österilecek özel mesaj veya özel mesaj ayarlanmamışsa boş dize.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Description()
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 kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Destination Id()
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 kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Destination Type()
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
Destination: Formun yanıt hedefinin türü.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Edit Url()
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: Formu düzenleme URL'si.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Editors()
Bu Form için düzenleyenlerin listesini alır.
Return
User[]: Düzenleme iznine sahip kullanıcı dizisi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Id()
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 kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Item By Id(id)
Belirli bir kimliğe sahip öğeyi alır. Kimlik, formdaki bir öğeyle eşleşmiyorsa 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|null: Belirtilen kimliğe sahip öğe veya öğe formda yoksa null.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Items()
Formdaki 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 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 kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Items(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 |
|---|---|---|
item | Item | Alınacak öğelerin türü. |
Return
Item[]: Bu türdeki tüm öğelerin dizisi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Published Readers()
Bu Form için yanıt verenlerin listesini 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 responders for the form. const users = form.getPublishedReaders(); users.forEach(user => console.log(user.getEmail()));
Return
User[]: Yanıtlama izni olan kullanıcıların dizisi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Published Url()
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 verme URL'si.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Response(responseId)
Yanıt kimliğine göre tek bir form yanıtı alır. Yanıt kimlikleri Form adresinden alınabilir.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
response | String | Form yanıtının kimliği. |
Return
Form — Form yanıtı.
Verdiği hatalar
Error: Yanıt yoksa
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Responses()
Formun tüm yanıtlarının dizisini alır.
Return
Form: Formun tüm yanıtlarının dizisi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Responses(timestamp)
Belirli bir tarih ve saatten sonraki tüm form 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
Form: Form yanıtlarının listesi.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Shuffle Questions()
Formun her sayfasındaki soruların sırasının rastgele olup olmayacağını belirler.
Return
Formun her sayfasındaki soruların sırası rastgele belirleniyorsa Boolean — true, aksi takdirde false.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Summary Url()
Form yanıtlarının özetini görüntülemek için kullanılabilecek URL'yi alır. set politikası true olarak ayarlanmadığı sürece URL'ye yalnızca formda düzenleme izni olan kullanıcılar 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 özetini görüntülemek için kullanılan URL.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Title()
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 kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
has Limit One Response Per User()
Formun, katılımcı başına yalnızca bir yanıta izin verip vermeyeceğini belirler. Değer true ise komut dosyası form yanıtlarını hiç gönderemez.
Return
Boolean: Form, yanıtlayan başına yalnızca bir yanıta izin veriyorsa true, aksi takdirde false.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
has Progress Bar()
Formda ilerleme çubuğu gösterilip gösterilmeyeceğ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österiliyorsa true, gösterilmiyorsa false.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
has Respond Again Link()
Formu yanıtlayan kişi formu tamamladıktan sonra formda başka bir yanıt gönderme bağlantısının gösterilip gösterilmeyeceğ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
Formda "Başka bir yanıt gönder" bağlantısı gösteriliyorsa Boolean, gösterilmiyorsa true.false
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
is Accepting Responses()
Formun şu anda yanıt kabul edip etmediğini belirler. Formun yayınlanma durumu değiştiğinde bu değerin üzerine yazı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', ); // 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
Form yanıt kabul ediyorsa Boolean, etmiyorsa true gösterilir.false
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
is Published()
Formun yayınlanıp yayınlanmadığını belirler.
Bu özellik yalnızca yayınlamayı destekleyen formlarda kullanılabilir. Formun yayınlamayı destekleyip desteklemediğini kontrol etmek için supports simgesini kullanın.
// 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 whether the form is published or not and logs it to the console. console.log(form.isPublished());
Return
Form yayınlandıysa Boolean, yayınlanmadıysa true.false
Verdiği hatalar
Error: Desteklenmeyen formlarda çağrılırsa.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
is Publishing Summary()
Formu dolduran bir katılımcıdan sonra formda yanıtların özetini görüntüleme bağlantısının gösterilip gösterilmeyeceğ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ör" bağlantısı gösteriliyorsa true, gösterilmiyorsa false.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
is Quiz()
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
Form yanıt kabul ediyorsa Boolean, etmiyorsa true gösterilir.false
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
move Item(from, to)
Formdaki tüm öğeler arasında belirli bir dizindeki bir öğeyi başka bir dizine taşır. to dizini sınırların dışındaysa komut dosyası oluşturma 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 indeksi. |
Return
Item: Taşınan öğe.
Verdiği hatalar
Error: İndekslerden biri sınırların dışındaysa.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
move Item(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ı oluşturma 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 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. |
to | Integer | Formdaki tüm öğeler arasında öğenin yeni indeksi. |
Return
Item: Taşınan öğe.
Verdiği hatalar
Error: Dizin sınırların dışındaysa.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
remove Destination()
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ı saklamaya devam eder. Hedefi açıkça ayarlanmamış olanlar da dahil olmak üzere tüm formlar, yanıtların bir kopyasını formun yanıt deposuna kaydeder. Formda şu anda yanıt hedefi yoksa bu yöntemin hiç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: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
remove Editor(emailAddress)
Belirtilen kullanıcıyı Form için düzenleyenler listesinden kaldırır. Bu yöntem, genel erişime sahip kullanıcı sınıfına ait olmaları durumunda kullanıcıların Form erişmesini engellemez. Örneğin, Form kullanıcının alanının tamamıyla paylaşılıyorsa veya Form kullanıcının erişebileceği bir ortak Drive'da bulunuyorsa.Form
Drive dosyaları için bu işlem, kullanıcıyı görüntüleyenler ve yanıtlayanlar listesinden de kaldırır.
// Opens the Forms file by its URL. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Removes the editor from the form. // TODO(developer): replace the emailAddress. form.removeEditor('editor@uni.edu');
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
email | String | Kaldırılacak kullanıcının e-posta adresi. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
remove Editor(user)
Belirtilen kullanıcıyı Form için düzenleyenler listesinden kaldırır. Bu yöntem, genel erişime sahip kullanıcı sınıfına ait olmaları durumunda kullanıcıların Form erişmesini engellemez. Örneğin, Form kullanıcının alanının tamamıyla paylaşılıyorsa veya Form kullanıcının erişebileceği bir ortak Drive'da bulunuyorsa.Form
Drive dosyaları için bu işlem, kullanıcıyı görüntüleyenler listesinden de kaldırır.
// Opens the Forms file by its URL. // TODO(developer): Replace the URL with your own. const form1 = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the editors from the form. const users = form1.getEditors(); // Opens another form. // TODO(developer): Replace the URL with your own. const form2 = FormApp.openByUrl('https://docs.google.com/forms/d/efg123456/edit'); // Removes editors from the form. users.forEach(user => form2.removeEditor(user));
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
user | User | Kaldırılacak kullanıcının temsili. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
remove Published Reader(emailAddress)
Belirtilen kullanıcıyı Form için yanıt verenler listesinden kaldırır. Bu yöntem, genel erişime sahip bir kullanıcı sınıfına ait olmaları durumunda kullanıcıların Form erişmesini engellemez. Örneğin, Form kullanıcının alanının tamamıyla paylaşılıyorsa veya Form kullanıcının erişebileceği bir ortak Drive'da bulunuyorsa.Form
Drive dosyaları için bu işlem, kullanıcıyı görüntüleyenler ve düzenleyenler listesinden de kaldırır.
// Opens the Forms file by its URL. // TODO(developer): Replace the URL with your own. const form = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Removes the responders from the form. // TODO(developer): replace the emailAddress. form.removePublishedReader('responder1@uni.edu');
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
email | String | Kaldırılacak kullanıcının e-posta adresi. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
remove Published Reader(user)
Belirtilen kullanıcıyı Form için yanıt verenler listesinden kaldırır. Bu yöntem, genel erişime sahip bir kullanıcı sınıfına ait olmaları durumunda kullanıcıların Form erişmesini engellemez. Örneğin, Form kullanıcının alanının tamamıyla paylaşılıyorsa veya Form, kullanıcının erişebileceği bir ortak Drive'da bulunuyorsa.Form
Drive dosyaları için bu işlem, kullanıcıyı görüntüleyenler ve düzenleyenler listesinden de kaldırır.
// Opens the Forms file by its URL. // TODO(developer): Replace the URL with your own. const form1 = FormApp.openByUrl('https://docs.google.com/forms/d/abc123456/edit'); // Gets the responders from the form. const users = form1.getPublishedReaders(); // Opens another form. // TODO(developer): Replace the URL with your own. const form2 = FormApp.openByUrl('https://docs.google.com/forms/d/efg123456/edit'); // Removes responders from the form. users.forEach(user => form2.removePublishedReader(user));
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
user | User | Kaldırılacak kullanıcının temsili. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Accepting Responses(enabled)
Formun şu anda yanıt kabul edip etmediğini ayarlar. Yeni formlar için varsayılan değer true'dır. Formun yayınlanma durumu değiştirildiğinde durumun üzerine yazı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', ); // 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 | Formun yanıt kabul etmesi gerekiyorsa true, etmemesi gerekiyorsa false'ı tıklayın. |
Return
Form: Zincirleme için bu Form.
Verdiği hatalar
Error (Yayınlanmamış bir formda etkinleştirilmişse)
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Allow Response Edits(enabled)
Formun, gönderildikten sonra yanıtı düzenleme bağlantısı gösterip göstermeyeceğini ayarlar. Yeni formların varsayılan değeri false'dır.
Bu ayardan bağımsız olarak Form yöntemi, forma düzenleme izni 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', ); // 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österilecekse true, gösterilmeyecekse false. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Collect Email(collect)
Formun, katılımcıların e-posta adreslerini toplayıp toplamayacağını belirler. Yeni formlar için varsayılan değer false'dir.
// 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 | Formun e-posta adreslerini toplaması gerekiyorsa true, gerekmiyorsa false. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Confirmation Message(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: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Custom Closed Form Message(message)
Form yanıt kabul etmiyorsa gösterilecek mesajı ayarlar. Mesaj ayarlanmamışsa formda varsayılan mesaj 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', ); // 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österilecek mesaj. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Description(description)
Formun açıklamasını ayarlar.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
description | String | Formun yeni açıklaması. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Destination(type, id)
Form yanıtlarının kaydedileceği hedefi belirler. Hedefi açıkça ayarlanmamış olanlar da dahil olmak üzere tüm formlar, yanıtların bir kopyasını formun yanıt deposuna kaydeder.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
type | Destination | Formun yanıt hedefinin türü. |
id | String | Formun yanıt hedefinin kimliği. |
Return
Form: Zincirleme için bu Form.
Verdiği hatalar
Error: Belirtilen hedef kimliği geçersizse
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Is Quiz(enabled)
Formun test olup olmadığını ayarlar. Yeni formlar için varsayılan değer false'dır.
Puan verilen sorulara yalnızca testlerde izin verilir. Bu nedenle, bu ayarın false olarak belirlenmesi, tüm sorulardan tüm puanlandırma seçeneklerinin kaldırılmasına neden olur.
Test ayarları yalnızca yeni Formlar kullanıcı arayüzünde kullanılabilir. Bir formu teste dönüştürmek 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ştirilip etkinleştirilmeyeceği (true) veya etkinleştirilmeyeceği (false). |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Limit One Response Per User(enabled)
Formun, yanıtlayan başına yalnızca bir yanıta izin verip vermeyeceğini ayarlar. Yeni formlar için varsayılan değer false'dir. Değer true olarak ayarlanırsa komut dosyası form yanıtlarını hiç gönderemez.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
enabled | Boolean | Form, katılımcı başına yalnızca bir yanıta izin vermeliyse true, aksi takdirde false. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Progress Bar(enabled)
Formda ilerleme çubuğu olup olmayacağını ayarlar. Yeni formlar için varsayılan değer false'dı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', ); // 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 ilerleme çubuğu gösteriliyorsa true, gösterilmiyorsa false simgesini tıklayın. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Published(enabled)
Formun yayınlanıp yayınlanmayacağını ayarlar. Yeni formlar için varsayılan değer true'dır.
Bu özellik yalnızca yayınlamayı destekleyen formlarda kullanılabilir. Formun yayınlamayı destekleyip desteklemediğini kontrol etmek için supports simgesini kullanın.
Katılımcıların erişebilmesi için formun yayınlanması gerekir. Bu yöntem, set çağrılarını geçersiz kılar.
// 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', ); // Publishes the form before sharing it. form.setPublished(true); // Checks whether the form is published or not and logs it to the console. console.log(form.isPublished());
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
enabled | Boolean | Form yayınlanacaksa true, yayınlanmayacaksa false. |
Return
Form: Zincirleme için bu Form.
Verdiği hatalar
Error: Desteklenmeyen formlarda çağrılırsa.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Publishing Summary(enabled)
Yanıtlayan formu gönderdikten sonra formda yanıtların özetini görüntüleme bağlantısının gösterilip gösterilmeyeceğini ayarlar. Yeni formlar için varsayılan değer false'dır.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
enabled | Boolean | Formda "Önceki yanıtları gör" bağlantısı gösterilecekse true, gösterilmeyecekse false. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Show Link To Respond Again(enabled)
Yanıtlayan formu tamamladıktan sonra formda başka bir yanıt gönderme bağlantısının gösterilip gösterilmeyeceğini ayarlar. Yeni formlar için varsayılan değer true'dır.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
enabled | Boolean | true Formda "Başka bir yanıt gönder" bağlantısı gösterilip gösterilmeyeceğini, false gösterilmeyecekse. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Shuffle Questions(shuffle)
Formun her sayfasındaki soruların sırasının rastgele belirlenip belirlenmeyeceğini ayarlar.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
shuffle | Boolean | true Formun her sayfasındaki soruların sırası rastgele mi olmalı? false Değilse. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Title(title)
Formun başlığını ayarlar.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
title | String | Formun yeni başlığı. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
shorten Form Url(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 kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
submit Grades(responses)
Belirli FormYanıtları için notları gönderir.
Kodunuzda bir on tetikleyici varsa submit çağrısı on koşulunu tetikler ve sonsuz döngüye neden olur. Sonsuz döngüyü önlemek için submit işlevi çağrılmadan önce notların mevcut olup olmadığını kontrol eden bir kod ekleyin.
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
responses | Form | Formun tüm yanıtlarının dizisi. |
Return
Form: Zincirleme için bu Form.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
supports Advanced Responder Permissions()
Formun yayınlamayı destekleyip desteklemediğini belirler. Bu yöntem, set ve is yöntemlerinin ve yanıtlayıcı izinlerinin kullanılabilir olup olmadığını belirlemek için 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', ); // Checks whether the form supports publishing or not and logs it to the // console. console.log(form.supportsAdvancedResponderPermissions());
Return
Boolean — Form yayınlamayı destekliyorsa true, desteklemiyorsa false.
Yetkilendirme
Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms