ऐसा फ़ॉर्म जिसमें सभी प्रॉपर्टी और आइटम शामिल हों. इन प्रॉपर्टी में टाइटल, सेटिंग, और जवाबों को सेव करने की जगह शामिल है. आइटम में, सवाल वाले आइटम शामिल होते हैं. जैसे, चेकबॉक्स या रेडियो आइटम. वहीं, लेआउट आइटम में पेज ब्रेक जैसी चीज़ें शामिल होती हैं. FormApp से फ़ॉर्म ऐक्सेस किए जा सकते हैं या बनाए जा सकते हैं.
// 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());
तरीके
| तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
|---|---|---|
add | Checkbox | यह फ़ंक्शन, कॉलम और लाइनों के ग्रिड के तौर पर दिखाए गए नए सवाल वाले आइटम को जोड़ता है. इससे जवाब देने वाला व्यक्ति, चेकबॉक्स के क्रम में मौजूद हर लाइन के लिए एक से ज़्यादा विकल्प चुन सकता है. |
add | Checkbox | यह एक नया सवाल जोड़ता है. इससे जवाब देने वाला व्यक्ति, एक या उससे ज़्यादा चेकबॉक्स चुन सकता है. साथ ही, "अन्य" फ़ील्ड में जानकारी दे सकता है. |
add | Date | यह फ़ंक्शन, सवाल के तौर पर एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, तारीख की जानकारी दे पाता है. |
add | Date | यह फ़ंक्शन, सवाल के तौर पर एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, तारीख और समय की जानकारी दे सकता है. |
add | Duration | यह फ़ंक्शन, सवाल वाला एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, समय की अवधि के बारे में बता सकता है. |
add | Form | यह फ़ंक्शन, दिए गए उपयोगकर्ता को Form के लिए संपादकों की सूची में जोड़ता है. |
add | Form | यह फ़ंक्शन, दिए गए उपयोगकर्ता को Form के लिए संपादकों की सूची में जोड़ता है. |
add | Form | यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Form के लिए संपादकों की सूची में जोड़ता है. |
add | Grid | यह फ़ंक्शन, सवालों के जवाब देने वाले व्यक्ति को एक नया सवाल जोड़ने की सुविधा देता है. यह सवाल, कॉलम और लाइनों के ग्रिड के तौर पर दिखता है. इसमें, जवाब देने वाला व्यक्ति रेडियो बटन की मदद से, हर लाइन के लिए एक विकल्प चुन सकता है. |
add | Image | यह फ़ंक्शन, इमेज दिखाने वाला नया लेआउट आइटम जोड़ता है. |
add | List | यह फ़ंक्शन, सवाल का एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, ड्रॉपडाउन सूची से कोई एक विकल्प चुन सकता है. |
add | Multiple | यह एक नया सवाल वाला आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, रेडियो बटन की सूची में से कोई एक विकल्प चुन सकता है. इसके अलावा, वह "अन्य" फ़ील्ड में भी जवाब दे सकता है. |
add | Page | यह एक नया लेआउट आइटम जोड़ता है, जो पेज की शुरुआत को मार्क करता है. |
add | Paragraph | इससे एक नया सवाल आइटम जुड़ता है. इसकी मदद से, जवाब देने वाला व्यक्ति टेक्स्ट का कोई ब्लॉक डाल सकता है. |
add | Form | इस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Form के लिए जवाब देने वाले लोगों की सूची में जोड़ा जाता है. |
add | Form | इस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Form के लिए जवाब देने वाले लोगों की सूची में जोड़ा जाता है. |
add | Form | यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Form के लिए जवाब देने वाले लोगों की सूची में जोड़ता है. |
add | Rating | यह कुकी, सवाल का एक नया आइटम जोड़ती है. इससे जवाब देने वाला व्यक्ति रेटिंग दे सकता है. |
add | Scale | यह एक नया सवाल जोड़ने वाला आइटम है. इससे जवाब देने वाला व्यक्ति, नंबर वाली रेडियो बटन की सूची में से कोई एक विकल्प चुन सकता है. |
add | Section | यह एक नया लेआउट आइटम जोड़ता है, जो सेक्शन की शुरुआत को दिखाता है. |
add | Text | यह एक नया सवाल वाला आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, एक लाइन का टेक्स्ट डाल सकता है. |
add | Time | यह एक नया सवाल जोड़ने वाला आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, दिन का समय बता सकता है. |
add | Video | यह फ़ंक्शन, वीडियो दिखाने वाला नया लेआउट आइटम जोड़ता है. |
can | Boolean | इससे यह तय होता है कि फ़ॉर्म सबमिट करने के बाद, जवाब में बदलाव करने के लिए लिंक दिखेगा या नहीं. |
collects | Boolean | इस कुकी से यह तय होता है कि फ़ॉर्म में जवाब देने वाले लोगों के ईमेल पते इकट्ठा किए जाते हैं या नहीं. |
create | Form | यह फ़ॉर्म के लिए नया जवाब बनाता है. |
delete | Form | यह फ़ॉर्म के जवाबों के स्टोर से, सबमिट किए गए सभी जवाबों को मिटा देता है. |
delete | void | यह फ़ॉर्म में मौजूद सभी आइटम में से, दिए गए इंडेक्स पर मौजूद आइटम को मिटाता है. |
delete | void | इस तरीके का इस्तेमाल करके, दिए गए आइटम को मिटाया जा सकता है. |
delete | Form | यह फ़ॉर्म के जवाबों के स्टोर से एक जवाब मिटाता है. |
get | String | इससे फ़ॉर्म के लिए पुष्टि करने वाला मैसेज मिलता है. |
get | String | यह फ़ंक्शन, वह कस्टम मैसेज दिखाता है जो तब दिखता है, जब फ़ॉर्म में जवाब स्वीकार नहीं किए जा रहे होते हैं. अगर कोई कस्टम मैसेज सेट नहीं किया गया है, तो यह फ़ंक्शन एक खाली स्ट्रिंग दिखाता है. |
get | String | इससे फ़ॉर्म की जानकारी मिलती है. |
get | String | फ़ॉर्म के जवाबों के डेस्टिनेशन का आईडी मिलता है. |
get | Destination | इससे फ़ॉर्म के जवाबों के डेस्टिनेशन का टाइप मिलता है. |
get | String | यह फ़ॉर्म के बदलाव मोड को ऐक्सेस करने के लिए इस्तेमाल किए जा सकने वाले यूआरएल को दिखाता है. |
get | User[] | इस Form के लिए एडिटर की सूची मिलती है. |
get | String | फ़ॉर्म का आईडी मिलता है. |
get | Item|null | यह फ़ंक्शन, दिए गए आईडी वाला आइटम दिखाता है. |
get | Item[] | फ़ॉर्म में मौजूद सभी आइटम की एक कलेक्शन दिखाता है. |
get | Item[] | यह फ़ंक्शन, दिए गए टाइप के सभी आइटम का ऐरे दिखाता है. |
get | User[] | इस Form के लिए, जवाब देने वाले लोगों की सूची मिलती है. |
get | String | यह फ़ॉर्म का जवाब देने के लिए इस्तेमाल किया जा सकने वाला यूआरएल दिखाता है. |
get | Form | यह फ़ॉर्म में मिले जवाब के आईडी के आधार पर, फ़ॉर्म में मिले किसी एक जवाब को दिखाता है. |
get | Form | इससे फ़ॉर्म के सभी जवाबों का कलेक्शन मिलता है. |
get | Form | यह फ़ंक्शन, किसी तारीख और समय के बाद फ़ॉर्म में मिले सभी जवाबों की एक कलेक्शन दिखाता है. |
get | Boolean | यह कुकी तय करती है कि फ़ॉर्म के हर पेज पर सवालों का क्रम रैंडम किया गया है या नहीं. |
get | String | यह फ़ॉर्म के जवाबों की खास जानकारी देखने के लिए इस्तेमाल किया जा सकने वाला यूआरएल दिखाता है. |
get | String | इससे फ़ॉर्म का टाइटल मिलता है. |
has | Boolean | यह कुकी तय करती है कि फ़ॉर्म में जवाब देने वाले हर व्यक्ति को सिर्फ़ एक जवाब देने की अनुमति है या नहीं. |
has | Boolean | यह कुकी तय करती है कि फ़ॉर्म में प्रोग्रेस बार दिखेगा या नहीं. |
has | Boolean | इससे यह तय होता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म पूरा करने के बाद, फ़ॉर्म में एक और जवाब सबमिट करने का लिंक दिखेगा या नहीं. |
is | Boolean | यह कुकी तय करती है कि फ़ॉर्म में जवाब स्वीकार किए जा रहे हैं या नहीं. |
is | Boolean | इससे यह तय होता है कि फ़ॉर्म पब्लिश किया गया है या नहीं. |
is | Boolean | इस कुकी से यह तय होता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म पूरा करने के बाद, फ़ॉर्म में जवाबों की खास जानकारी देखने के लिए लिंक दिखेगा या नहीं. |
is | Boolean | यह तय करता है कि फ़ॉर्म, क्विज़ है या नहीं. |
move | Item | यह फ़ंक्शन, फ़ॉर्म में मौजूद सभी आइटम में से किसी आइटम को दिए गए इंडेक्स से दूसरे इंडेक्स पर ले जाता है. |
move | Item | इस फ़ंक्शन का इस्तेमाल करके, किसी आइटम को फ़ॉर्म में मौजूद सभी आइटम के बीच किसी इंडेक्स पर ले जाया जा सकता है. |
remove | Form | इस फ़ंक्शन का इस्तेमाल करके, फ़ॉर्म को उसके मौजूदा जवाब के डेस्टिनेशन से अनलिंक किया जाता है. |
remove | Form | इस विकल्प से, दिए गए उपयोगकर्ता को Form के एडिटर की सूची से हटा दिया जाता है. |
remove | Form | इस विकल्प से, दिए गए उपयोगकर्ता को Form के एडिटर की सूची से हटा दिया जाता है. |
remove | Form | यह दिए गए उपयोगकर्ता को Form के जवाब देने वालों की सूची से हटाता है. |
remove | Form | यह दिए गए उपयोगकर्ता को Form के जवाब देने वालों की सूची से हटाता है. |
set | Form | इस कुकी से यह तय होता है कि फ़ॉर्म में जवाब स्वीकार किए जा रहे हैं या नहीं. |
set | Form | इस विकल्प से यह तय किया जाता है कि जवाब सबमिट करने के बाद, फ़ॉर्म में जवाब में बदलाव करने का लिंक दिखेगा या नहीं. |
set | Form | यह कुकी सेट करती है कि फ़ॉर्म में जवाब देने वाले लोगों के ईमेल पते इकट्ठा किए जाएं या नहीं. |
set | Form | यह कुकी, फ़ॉर्म के लिए पुष्टि करने वाला मैसेज सेट करती है. |
set | Form | अगर फ़ॉर्म में जवाब स्वीकार नहीं किए जा रहे हैं, तो यह विकल्प मैसेज सेट करता है. |
set | Form | यह फ़ॉर्म का ब्यौरा सेट करता है. |
set | Form | इससे वह डेस्टिनेशन सेट होता है जहां फ़ॉर्म के जवाब सेव किए जाते हैं. |
set | Form | इससे यह सेट किया जाता है कि फ़ॉर्म, क्विज़ है या नहीं. |
set | Form | इस विकल्प से यह तय किया जाता है कि फ़ॉर्म में जवाब देने वाले हर व्यक्ति को सिर्फ़ एक जवाब देने की अनुमति है या नहीं. |
set | Form | इससे यह सेट किया जाता है कि फ़ॉर्म में प्रोग्रेस बार है या नहीं. |
set | Form | इससे यह तय होता है कि फ़ॉर्म पब्लिश किया गया है या नहीं. |
set | Form | इससे यह तय होता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म सबमिट करने के बाद, फ़ॉर्म में जवाबों की खास जानकारी देखने के लिए लिंक दिखेगा या नहीं. |
set | Form | इस विकल्प से यह तय किया जाता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म पूरा करने के बाद, फ़ॉर्म में एक और जवाब सबमिट करने का लिंक दिखेगा या नहीं. |
set | Form | इस कुकी से यह तय होता है कि फ़ॉर्म के हर पेज पर सवालों का क्रम रैंडम किया गया है या नहीं. |
set | Form | इससे फ़ॉर्म का टाइटल सेट किया जाता है. |
shorten | String | यह फ़ंक्शन, फ़ॉर्म के लंबे यूआरएल को छोटे यूआरएल में बदलता है. |
submit | Form | यह फ़ंक्शन, दी गई FormResponses के लिए ग्रेड सबमिट करता है. |
supports | Boolean | यह कुकी तय करती है कि फ़ॉर्म को पब्लिश किया जा सकता है या नहीं. |
ज़्यादा जानकारी वाला दस्तावेज़
addCheckboxGridItem()
यह फ़ंक्शन, कॉलम और लाइनों के ग्रिड के तौर पर दिखाए गए नए सवाल वाले आइटम को जोड़ता है. इससे जवाब देने वाला व्यक्ति, चेकबॉक्स के क्रम में मौजूद हर लाइन के लिए एक से ज़्यादा विकल्प चुन सकता है.
// 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' ]);
वापसी का टिकट
CheckboxGridItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addCheckboxItem()
यह एक नया सवाल जोड़ता है. इससे जवाब देने वाला व्यक्ति, एक या उससे ज़्यादा चेकबॉक्स चुन सकता है. साथ ही, "अन्य" फ़ील्ड में जानकारी दे सकता है.
// 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']);
वापसी का टिकट
CheckboxItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addDateItem()
यह फ़ंक्शन, सवाल के तौर पर एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, तारीख की जानकारी दे पाता है.
// 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.');
वापसी का टिकट
DateItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addDateTimeItem()
यह फ़ंक्शन, सवाल के तौर पर एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, तारीख और समय की जानकारी दे सकता है.
// 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);
वापसी का टिकट
DateTimeItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addDurationItem()
यह फ़ंक्शन, सवाल वाला एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, समय की अवधि के बारे में बता सकता है.
// 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);
वापसी का टिकट
DurationItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addEditor(emailAddress)
यह फ़ंक्शन, दिए गए उपयोगकर्ता को Form के लिए संपादकों की सूची में जोड़ता है. अगर उपयोगकर्ता, दर्शकों या जवाब देने वालों की सूची में पहले से ही शामिल था, तो इस तरीके से उपयोगकर्ता को सूची से हटा दिया जाता है.
// 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');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | जिस उपयोगकर्ता को जोड़ना है उसका ईमेल पता. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addEditor(user)
यह फ़ंक्शन, दिए गए उपयोगकर्ता को Form के लिए संपादकों की सूची में जोड़ता है. अगर उपयोगकर्ता, दर्शकों या जवाब देने वालों की सूची में पहले से ही शामिल था, तो इस तरीके से उपयोगकर्ता को सूची से हटा दिया जाता है.
// 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));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | जोड़े जाने वाले उपयोगकर्ता का प्रतिनिधित्व. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addEditors(emailAddresses)
यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Form के लिए संपादकों की सूची में जोड़ता है. अगर कोई उपयोगकर्ता पहले से ही दर्शकों की सूची में शामिल है, तो इस तरीके से उसे दर्शकों की सूची से हटा दिया जाता है.
// 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']);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String[] | जोड़े जाने वाले उपयोगकर्ताओं के ईमेल पतों की एक कैटगरी. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addGridItem()
यह फ़ंक्शन, सवालों के जवाब देने वाले व्यक्ति को एक नया सवाल जोड़ने की सुविधा देता है. यह सवाल, कॉलम और लाइनों के ग्रिड के तौर पर दिखता है. इसमें, जवाब देने वाला व्यक्ति रेडियो बटन की मदद से, हर लाइन के लिए एक विकल्प चुन सकता है.
// 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' ]);
वापसी का टिकट
GridItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addImageItem()
यह फ़ंक्शन, इमेज दिखाने वाला नया लेआउट आइटम जोड़ता है.
// 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);
वापसी का टिकट
ImageItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addListItem()
यह फ़ंक्शन, सवाल का एक नया आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, ड्रॉपडाउन सूची से कोई एक विकल्प चुन सकता है.
// 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')]);
वापसी का टिकट
ListItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addMultipleChoiceItem()
यह एक नया सवाल वाला आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, रेडियो बटन की सूची में से कोई एक विकल्प चुन सकता है. इसके अलावा, वह "अन्य" फ़ील्ड में भी जवाब दे सकता है.
// 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]);
वापसी का टिकट
MultipleChoiceItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addPageBreakItem()
यह एक नया लेआउट आइटम जोड़ता है, जो पेज की शुरुआत को मार्क करता है.
// 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);
वापसी का टिकट
PageBreakItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addParagraphTextItem()
इससे एक नया सवाल आइटम जुड़ता है. इसकी मदद से, जवाब देने वाला व्यक्ति टेक्स्ट का कोई ब्लॉक डाल सकता है.
// 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?');
वापसी का टिकट
ParagraphTextItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addPublishedReader(emailAddress)
इस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Form के लिए जवाब देने वाले लोगों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही संपादकों या दर्शकों की सूची में शामिल है, तो इस तरीके का कोई असर नहीं पड़ता.
// 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');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | जिस उपयोगकर्ता को जोड़ना है उसका ईमेल पता. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addPublishedReader(user)
इस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Form के लिए जवाब देने वाले लोगों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही संपादकों या दर्शकों की सूची में शामिल है, तो इस तरीके का कोई असर नहीं पड़ता.
// 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));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | जोड़े जाने वाले उपयोगकर्ता का प्रतिनिधित्व. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addPublishedReaders(emailAddresses)
यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Form के लिए जवाब देने वाले लोगों की सूची में जोड़ता है. अगर उपयोगकर्ता पहले से ही संपादकों या दर्शकों की सूची में शामिल है, तो इस तरीके का कोई असर नहीं पड़ता.
// 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']);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String[] | जोड़े जाने वाले उपयोगकर्ताओं के ईमेल पतों की एक कैटगरी. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addRatingItem()
यह कुकी, सवाल का एक नया आइटम जोड़ती है. इससे जवाब देने वाला व्यक्ति रेटिंग दे सकता है.
// 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();
वापसी का टिकट
RatingItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addScaleItem()
यह एक नया सवाल जोड़ने वाला आइटम है. इससे जवाब देने वाला व्यक्ति, नंबर वाली रेडियो बटन की सूची में से कोई एक विकल्प चुन सकता है.
// 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');
वापसी का टिकट
ScaleItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addSectionHeaderItem()
यह एक नया लेआउट आइटम जोड़ता है, जो सेक्शन की शुरुआत को दिखाता है.
// 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');
वापसी का टिकट
SectionHeaderItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addTextItem()
यह एक नया सवाल वाला आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, एक लाइन का टेक्स्ट डाल सकता है.
// 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?');
वापसी का टिकट
TextItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addTimeItem()
यह एक नया सवाल जोड़ने वाला आइटम जोड़ता है. इससे जवाब देने वाला व्यक्ति, दिन का समय बता सकता है.
// 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?');
वापसी का टिकट
TimeItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
addVideoItem()
यह फ़ंक्शन, वीडियो दिखाने वाला नया लेआउट आइटम जोड़ता है.
// 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);
वापसी का टिकट
VideoItem — यह नया आइटम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
canEditResponse()
इससे यह तय होता है कि फ़ॉर्म सबमिट करने के बाद, जवाब में बदलाव करने के लिए लिंक दिखेगा या नहीं.
इस सेटिंग के बावजूद, FormResponse.getEditResponseUrl() तरीके से स्क्रिप्ट लिखने वाला व्यक्ति, फ़ॉर्म में बदलाव करने का ऐक्सेस पा सकता है. इससे वह एक ऐसा यूआरएल जनरेट कर सकता है जिसका इस्तेमाल जवाब में बदलाव करने के लिए किया जा सकता है.
// 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);
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में "अपने जवाब में बदलाव करें" लिंक दिखता है; false अगर नहीं दिखता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
collectsEmail()
इससे यह तय होता है कि फ़ॉर्म में जवाब देने वालों के ईमेल पते इकट्ठा किए जाते हैं या नहीं.
// 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);
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में ईमेल पते इकट्ठा किए जाते हैं; false अगर ऐसा नहीं किया जाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
createResponse()
यह फ़ॉर्म के लिए नया जवाब बनाता है. किसी सवाल का जवाब देने के लिए, आइटम से ItemResponse बनाएं. इसके बाद, FormResponse.withItemResponse(response) को कॉल करके, इसे इस फ़ॉर्म के जवाब से अटैच करें. जवाब को सेव करने के लिए, FormResponse.submit() को कॉल करें.
वापसी का टिकट
FormResponse — यह नया फ़ॉर्म रिस्पॉन्स है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
deleteAllResponses()
यह फ़ॉर्म के जवाबों के स्टोर से, सबमिट किए गए सभी जवाबों को मिटा देता है. इस तरीके से, जवाबों की उन कॉपी को नहीं मिटाया जाता जिन्हें किसी बाहरी जगह (जैसे कि स्प्रेडशीट) पर सेव किया गया है. हालांकि, इससे फ़ॉर्म के खास जानकारी वाले व्यू को मिटा दिया जाता है.
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
deleteItem(index)
यह फ़ॉर्म में मौजूद सभी आइटम में से, दिए गए इंडेक्स पर मौजूद आइटम को मिटाता है. अगर दिए गए इंडेक्स पर कोई आइटम मौजूद नहीं है, तो यह फ़ंक्शन स्क्रिप्टिंग से जुड़ी गड़बड़ी दिखाता है.
// 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); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
index | Integer | फ़ॉर्म में मौजूद सभी आइटम में से, आइटम का इंडेक्स. |
थ्रॉ
Error — अगर दिए गए इंडेक्स पर कोई आइटम मौजूद नहीं है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
deleteItem(item)
इस तरीके का इस्तेमाल करके, दिए गए आइटम को मिटाया जा सकता है. अगर आइटम पहले ही मिटा दिया गया है, तो यह फ़ंक्शन स्क्रिप्टिंग से जुड़ी गड़बड़ी दिखाता है.
// 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); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
item | Item | वह आइटम जिसे मिटाना है. |
थ्रॉ
Error — अगर आइटम फ़ॉर्म में मौजूद नहीं है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
deleteResponse(responseId)
यह फ़ॉर्म के जवाबों के स्टोर से एक जवाब मिटाता है. इस तरीके से, जवाबों की उन कॉपी को नहीं मिटाया जाता जिन्हें जवाबों के लिए तय की गई किसी बाहरी जगह (जैसे कि स्प्रेडशीट) पर सेव किया गया है. हालांकि, इससे फ़ॉर्म के खास जानकारी वाले व्यू से जवाब हट जाता है. FormResponse.getId() की मदद से, जवाब का आईडी वापस पाया जा सकता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
response | String | मिटाने के लिए फ़ॉर्म में दिए गए जवाब का आईडी. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getConfirmationMessage()
इससे फ़ॉर्म के लिए पुष्टि करने वाला मैसेज मिलता है.
// 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);
वापसी का टिकट
String — फ़ॉर्म सबमिट होने के बाद दिखने वाला मैसेज.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getCustomClosedFormMessage()
यह फ़ंक्शन, वह कस्टम मैसेज दिखाता है जो तब दिखता है, जब फ़ॉर्म में जवाब स्वीकार नहीं किए जा रहे होते हैं. अगर कोई कस्टम मैसेज सेट नहीं किया गया है, तो यह फ़ंक्शन एक खाली स्ट्रिंग दिखाता है.
// 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);
वापसी का टिकट
String — अगर फ़ॉर्म में जवाब स्वीकार नहीं किए जा रहे हैं, तो दिखाने के लिए कस्टम मैसेज. अगर कोई कस्टम मैसेज सेट नहीं किया गया है, तो खाली स्ट्रिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getDescription()
इससे फ़ॉर्म की जानकारी मिलती है.
// 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);
वापसी का टिकट
String — फ़ॉर्म का ब्यौरा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getDestinationId()
फ़ॉर्म के जवाबों के डेस्टिनेशन का आईडी मिलता है.
// 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);
वापसी का टिकट
String — फ़ॉर्म के जवाबों के डेस्टिनेशन का आईडी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getDestinationType()
इससे फ़ॉर्म के जवाबों के डेस्टिनेशन का टाइप मिलता है.
// 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);
वापसी का टिकट
DestinationType — फ़ॉर्म के जवाबों के डेस्टिनेशन का टाइप.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getEditUrl()
यह फ़ॉर्म के बदलाव मोड को ऐक्सेस करने के लिए इस्तेमाल किए जा सकने वाले यूआरएल को दिखाता है.
// 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);
वापसी का टिकट
String — फ़ॉर्म में बदलाव करने का यूआरएल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getEditors()
इस Form के लिए एडिटर की सूची मिलती है.
वापसी का टिकट
User[] — बदलाव करने की अनुमति वाले उपयोगकर्ताओं की एक सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getId()
फ़ॉर्म का आईडी मिलता है.
// 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);
वापसी का टिकट
String — फ़ॉर्म का आईडी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getItemById(id)
यह फ़ंक्शन, दिए गए आईडी वाला आइटम दिखाता है. अगर आईडी, फ़ॉर्म में मौजूद किसी आइटम से मेल नहीं खाता है, तो null दिखाता है.
// 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);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
id | Integer | आइटम का आईडी. |
वापसी का टिकट
Item|null — दिए गए आईडी वाला आइटम या अगर आइटम फ़ॉर्म में मौजूद नहीं है, तो null.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getItems()
फ़ॉर्म में मौजूद सभी आइटम की एक कलेक्शन दिखाता है.
// 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);
वापसी का टिकट
Item[] — फ़ॉर्म में मौजूद सभी आइटम का कलेक्शन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getItems(itemType)
यह फ़ंक्शन, दिए गए टाइप के सभी आइटम का ऐरे दिखाता है.
// 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);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
item | Item | पाए जाने वाले आइटम का टाइप. |
वापसी का टिकट
Item[] — उस टाइप के सभी आइटम की एक कैटगरी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getPublishedReaders()
इस Form के लिए, जवाब देने वाले लोगों की सूची मिलती है.
// 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()));
वापसी का टिकट
User[] — यह जवाब देने की अनुमति वाले उपयोगकर्ताओं की एक सूची होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getPublishedUrl()
यह फ़ॉर्म का जवाब देने के लिए इस्तेमाल किया जा सकने वाला यूआरएल दिखाता है.
// 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);
वापसी का टिकट
String — फ़ॉर्म का जवाब देने के लिए यूआरएल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getResponse(responseId)
यह फ़ॉर्म में मिले जवाब के आईडी के आधार पर, फ़ॉर्म में मिले किसी एक जवाब को दिखाता है. जवाब के आईडी, FormResponse.getId() से वापस पाए जा सकते हैं.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
response | String | फ़ॉर्म भरने वाले व्यक्ति का आईडी. |
वापसी का टिकट
FormResponse — फ़ॉर्म में मिला जवाब.
थ्रॉ
Error — अगर जवाब मौजूद नहीं है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getResponses()
इससे फ़ॉर्म के सभी जवाबों का कलेक्शन मिलता है.
वापसी का टिकट
FormResponse[] — फ़ॉर्म में मिले सभी जवाबों का कलेक्शन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getResponses(timestamp)
यह फ़ंक्शन, किसी तारीख और समय के बाद फ़ॉर्म में मिले सभी जवाबों की एक कलेक्शन दिखाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
timestamp | Date | वह सबसे पहली तारीख और समय जिसके लिए फ़ॉर्म के जवाब दिखाए जाने चाहिए. |
वापसी का टिकट
FormResponse[] — फ़ॉर्म में मिले जवाबों की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getShuffleQuestions()
यह कुकी तय करती है कि फ़ॉर्म के हर पेज पर सवालों का क्रम रैंडम किया गया है या नहीं.
वापसी का टिकट
Boolean — true अगर फ़ॉर्म के हर पेज पर सवालों का क्रम रैंडम किया गया है;
false अगर नहीं किया गया है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getSummaryUrl()
यह फ़ॉर्म के जवाबों की खास जानकारी देखने के लिए इस्तेमाल किया जा सकने वाला यूआरएल दिखाता है. जब तक setPublishingSummary(enabled) को 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. // 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);
वापसी का टिकट
String — जवाबों की खास जानकारी देखने के लिए यूआरएल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
getTitle()
इससे फ़ॉर्म का टाइटल मिलता है.
// 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);
वापसी का टिकट
String — फ़ॉर्म का टाइटल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
hasLimitOneResponsePerUser()
यह कुकी तय करती है कि फ़ॉर्म में जवाब देने वाले हर व्यक्ति को सिर्फ़ एक जवाब देने की अनुमति है या नहीं. अगर वैल्यू true पर सेट है, तो स्क्रिप्ट फ़ॉर्म के जवाब सबमिट नहीं कर सकती.
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में, जवाब देने वाले हर व्यक्ति को सिर्फ़ एक जवाब देने की अनुमति है; false अगर ऐसा नहीं है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
hasProgressBar()
यह कुकी तय करती है कि फ़ॉर्म में प्रोग्रेस बार दिखेगा या नहीं.
// 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());
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में प्रोग्रेस बार दिखता है; false अगर नहीं दिखता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
hasRespondAgainLink()
इससे यह तय होता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म पूरा करने के बाद, फ़ॉर्म में एक और जवाब सबमिट करने का लिंक दिखेगा या नहीं.
// 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());
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में "दूसरा जवाब सबमिट करें" लिंक दिखता है; false अगर नहीं दिखता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
isAcceptingResponses()
यह कुकी तय करती है कि फ़ॉर्म में जवाब स्वीकार किए जा रहे हैं या नहीं. फ़ॉर्म के पब्लिशिंग स्टेटस में बदलाव होने पर, यह वैल्यू बदल जाती है.
// 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);
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में जवाब देने की सुविधा चालू है; false अगर यह सुविधा बंद है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
isPublished()
इससे यह तय होता है कि फ़ॉर्म पब्लिश किया गया है या नहीं.
यह सुविधा सिर्फ़ उन फ़ॉर्म के लिए उपलब्ध है जिन्हें पब्लिश किया जा सकता है. supportsAdvancedResponderPermissions() का इस्तेमाल करके देखें कि फ़ॉर्म में पब्लिश करने की सुविधा काम करती है या नहीं.
// 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());
वापसी का टिकट
Boolean — अगर फ़ॉर्म पब्लिश किया गया है, तो true; अगर नहीं किया गया है, तो false.
थ्रॉ
Error — अगर इसे ऐसे फ़ॉर्म पर कॉल किया जाता है जिस पर यह काम नहीं करता.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
isPublishingSummary()
इस कुकी से यह तय होता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म पूरा करने के बाद, फ़ॉर्म में जवाबों की खास जानकारी देखने के लिए लिंक दिखेगा या नहीं.
// 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);
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में "पिछले जवाब देखें" लिंक दिखता है; false अगर नहीं दिखता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
isQuiz()
यह तय करता है कि फ़ॉर्म, क्विज़ है या नहीं.
// 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());
वापसी का टिकट
Boolean — true अगर फ़ॉर्म में जवाब देने की सुविधा चालू है; false अगर यह सुविधा बंद है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
moveItem(from, to)
यह फ़ंक्शन, फ़ॉर्म में मौजूद सभी आइटम में से किसी आइटम को दिए गए इंडेक्स से हटाकर, दिए गए दूसरे इंडेक्स पर ले जाता है. अगर to इंडेक्स तय सीमा से ज़्यादा है, तो यह फ़ंक्शन स्क्रिप्टिंग से जुड़ी गड़बड़ी दिखाता है.
// 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);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
from | Integer | फ़ॉर्म में मौजूद सभी आइटम में से, आइटम का मौजूदा इंडेक्स. |
to | Integer | फ़ॉर्म में मौजूद सभी आइटम में से, आइटम का नया इंडेक्स. |
वापसी का टिकट
Item — वह आइटम जिसे दूसरी जगह ले जाया गया है.
थ्रॉ
Error — अगर कोई भी इंडेक्स तय सीमा से ज़्यादा है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
moveItem(item, toIndex)
इस फ़ंक्शन का इस्तेमाल करके, किसी आइटम को फ़ॉर्म में मौजूद सभी आइटम के बीच किसी इंडेक्स पर ले जाया जा सकता है. अगर दिया गया इंडेक्स तय सीमा से बाहर है, तो यह स्क्रिप्टिंग से जुड़ी गड़बड़ी दिखाता है.
// 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);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
item | Item | वह आइटम जिसे मूव करना है. |
to | Integer | फ़ॉर्म में मौजूद सभी आइटम में से, आइटम का नया इंडेक्स. |
वापसी का टिकट
Item — वह आइटम जिसे दूसरी जगह ले जाया गया है.
थ्रॉ
Error — अगर इंडेक्स तय सीमा से ज़्यादा है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
removeDestination()
इस फ़ंक्शन का इस्तेमाल करके, फ़ॉर्म को उसके मौजूदा जवाब के डेस्टिनेशन से अनलिंक किया जाता है. अनलिंक किए गए पुराने डेस्टिनेशन में, अब भी पिछले सभी जवाबों की कॉपी मौजूद रहती है. सभी फ़ॉर्म, फ़ॉर्म के जवाबों के स्टोर में जवाबों की एक कॉपी सेव करते हैं. इनमें वे फ़ॉर्म भी शामिल हैं जिनके लिए डेस्टिनेशन साफ़ तौर पर सेट नहीं किया गया है. अगर फ़ॉर्म में फ़िलहाल कोई जवाब डेस्टिनेशन नहीं है, तो इस तरीके का कोई असर नहीं होगा.
// 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();
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
removeEditor(emailAddress)
इस विकल्प से, दिए गए उपयोगकर्ता को Form के एडिटर की सूची से हटा दिया जाता है. अगर उपयोगकर्ता, उन उपयोगकर्ताओं की क्लास में शामिल हैं जिनके पास सामान्य ऐक्सेस है, तो यह तरीका उन्हें Form ऐक्सेस करने से नहीं रोकता. उदाहरण के लिए, अगर Form को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Form, शेयर की गई ऐसी ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.Form
Drive की फ़ाइलों के लिए, इससे उपयोगकर्ता को व्यूअर और जवाब देने वालों की सूची से भी हटा दिया जाता है.
// 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');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | उस उपयोगकर्ता का ईमेल पता जिसे हटाना है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
removeEditor(user)
इस विकल्प से, दिए गए उपयोगकर्ता को Form के एडिटर की सूची से हटा दिया जाता है. अगर उपयोगकर्ता, उन उपयोगकर्ताओं की क्लास में शामिल हैं जिनके पास सामान्य ऐक्सेस है, तो यह तरीका उन्हें Form ऐक्सेस करने से नहीं रोकता. उदाहरण के लिए, अगर Form को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Form, शेयर की गई ऐसी ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.Form
Drive में मौजूद फ़ाइलों के लिए, इससे उपयोगकर्ता को व्यूअर की सूची से भी हटा दिया जाता है.
// 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));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | उस उपयोगकर्ता का प्रतिनिधित्व जिसे हटाना है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
removePublishedReader(emailAddress)
यह दिए गए उपयोगकर्ता को Form के जवाब देने वालों की सूची से हटाता है. अगर उपयोगकर्ता ऐसे लोगों की कैटगरी में आता है जिनके पास सामान्य ऐक्सेस है, तो इस तरीके से उन्हें Form को ऐक्सेस करने से नहीं रोका जा सकता. उदाहरण के लिए, अगर Form को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Form किसी ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.Form
Drive की फ़ाइलों के लिए, इससे उपयोगकर्ता को दर्शक और संपादक की सूची से भी हटा दिया जाता है.
// 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');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | उस उपयोगकर्ता का ईमेल पता जिसे हटाना है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
removePublishedReader(user)
यह दिए गए उपयोगकर्ता को Form के जवाब देने वालों की सूची से हटाता है. अगर उपयोगकर्ता ऐसे लोगों की कैटगरी में आता है जिनके पास सामान्य ऐक्सेस है, तो इस तरीके से उन्हें Form को ऐक्सेस करने से नहीं रोका जा सकता. उदाहरण के लिए, अगर Form को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Form किसी ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.Form
Drive की फ़ाइलों के लिए, इससे उपयोगकर्ता को दर्शक और संपादक की सूची से भी हटा दिया जाता है.
// 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));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | उस उपयोगकर्ता का प्रतिनिधित्व जिसे हटाना है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setAcceptingResponses(enabled)
इस कुकी से यह तय होता है कि फ़ॉर्म में जवाब स्वीकार किए जा रहे हैं या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग 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());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | true अगर फ़ॉर्म में जवाब स्वीकार किए जाने चाहिए; false अगर जवाब स्वीकार नहीं किए जाने चाहिए. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
थ्रॉ
Error — अगर इसे पब्लिश नहीं किए गए फ़ॉर्म पर चालू किया गया है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setAllowResponseEdits(enabled)
इस विकल्प से यह तय किया जाता है कि जवाब सबमिट करने के बाद, फ़ॉर्म में जवाब में बदलाव करने का लिंक दिखेगा या नहीं. नए फ़ॉर्म के लिए, डिफ़ॉल्ट सेटिंग false होती है.
इस सेटिंग के बावजूद, FormResponse.getEditResponseUrl() तरीके से स्क्रिप्ट लिखने वाला व्यक्ति, फ़ॉर्म में बदलाव करने की अनुमति पा सकता है. इससे वह एक ऐसा यूआरएल जनरेट कर सकता है जिसका इस्तेमाल जवाब में बदलाव करने के लिए किया जा सकता है.
// 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());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | true अगर फ़ॉर्म में "अपने जवाब में बदलाव करें" लिंक दिखाना है, तो false अगर नहीं दिखाना है, तो. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setCollectEmail(collect)
यह कुकी सेट करती है कि फ़ॉर्म में जवाब देने वालों के ईमेल पते इकट्ठा किए जाएं या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग 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);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
collect | Boolean | true अगर फ़ॉर्म में ईमेल पते इकट्ठा किए जाने चाहिए; false अगर ऐसा नहीं है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setConfirmationMessage(message)
यह कुकी, फ़ॉर्म के लिए पुष्टि करने वाला मैसेज सेट करती है.
// 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);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
message | String | फ़ॉर्म के लिए पुष्टि करने वाला नया मैसेज. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setCustomClosedFormMessage(message)
अगर फ़ॉर्म में जवाब स्वीकार नहीं किए जा रहे हैं, तो यह विकल्प मैसेज सेट करता है. अगर कोई मैसेज सेट नहीं किया गया है, तो फ़ॉर्म में डिफ़ॉल्ट मैसेज का इस्तेमाल किया जाता है.
// 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);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
message | String | अगर फ़ॉर्म में जवाब स्वीकार नहीं किए जा रहे हैं, तो दिखने वाला मैसेज. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setDescription(description)
यह फ़ॉर्म का ब्यौरा सेट करता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
description | String | फ़ॉर्म की नई जानकारी. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setDestination(type, id)
इससे वह डेस्टिनेशन सेट होता है जहां फ़ॉर्म के जवाब सेव किए जाते हैं. सभी फ़ॉर्म, जिनमें वे फ़ॉर्म भी शामिल हैं जिनके लिए डेस्टिनेशन साफ़ तौर पर सेट नहीं किया गया है, फ़ॉर्म के जवाबों की एक कॉपी, फ़ॉर्म के जवाबों के स्टोर में सेव करते हैं.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
type | Destination | फ़ॉर्म के जवाबों को सेव करने की जगह का टाइप. |
id | String | फ़ॉर्म के जवाबों के डेस्टिनेशन का आईडी. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
थ्रॉ
Error — अगर दिया गया डेस्टिनेशन आईडी अमान्य है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setIsQuiz(enabled)
इससे यह सेट किया जाता है कि फ़ॉर्म, क्विज़ है या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग false है.
ग्रेड किए गए सवालों का इस्तेमाल सिर्फ़ क्विज़ में किया जा सकता है. इसलिए, इसे false पर सेट करने से, सभी सवालों से ग्रेडिंग के सभी विकल्प हट जाते हैं.
क्विज़ की सेटिंग सिर्फ़ Forms के नए यूज़र इंटरफ़ेस (यूआई) में उपलब्ध हैं. किसी फ़ॉर्म को क्विज़ के तौर पर सेट करने पर, वह फ़ॉर्म नए यूआई का इस्तेमाल करने लगता है.
// 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());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | अगर फ़ॉर्म के लिए क्विज़ की सुविधाएं चालू करनी हैं, तो true; अगर नहीं, तो false. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setLimitOneResponsePerUser(enabled)
इस विकल्प से यह तय किया जाता है कि फ़ॉर्म में जवाब देने वाले हर व्यक्ति को सिर्फ़ एक जवाब देने की अनुमति है या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग false है. अगर यह वैल्यू true पर सेट होती है, तो स्क्रिप्ट फ़ॉर्म के जवाब सबमिट नहीं कर सकती.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | true अगर फ़ॉर्म में, जवाब देने वाले हर व्यक्ति को सिर्फ़ एक जवाब देने की अनुमति देनी है; false अगर ऐसा नहीं करना है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setProgressBar(enabled)
इससे यह सेट किया जाता है कि फ़ॉर्म में प्रोग्रेस बार है या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग 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());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | true अगर फ़ॉर्म में प्रोग्रेस बार दिखता है; false अगर नहीं दिखता है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setPublished(enabled)
इससे यह तय होता है कि फ़ॉर्म पब्लिश किया गया है या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग true है.
यह सुविधा सिर्फ़ उन फ़ॉर्म के लिए उपलब्ध है जिन्हें पब्लिश किया जा सकता है. supportsAdvancedResponderPermissions() का इस्तेमाल करके देखें कि फ़ॉर्म में पब्लिश करने की सुविधा काम करती है या नहीं.
जवाब देने वाले लोगों को फ़ॉर्म ऐक्सेस करने के लिए, उसे पब्लिश करना ज़रूरी है. यह तरीका, setAcceptingResponses(enabled) को कॉल करने के बजाय इस्तेमाल किया जाता है.
// 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());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | अगर फ़ॉर्म पब्लिश किया जाना चाहिए, तो true. अगर नहीं, तो false. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
थ्रॉ
Error — अगर इसे ऐसे फ़ॉर्म पर कॉल किया जाता है जिस पर यह काम नहीं करता.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setPublishingSummary(enabled)
इससे यह तय होता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म सबमिट करने के बाद, फ़ॉर्म में जवाबों की खास जानकारी देखने के लिए लिंक दिखेगा या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग false है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | true अगर फ़ॉर्म में "पिछले जवाब देखें" लिंक दिखाना है; false अगर नहीं दिखाना है. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setShowLinkToRespondAgain(enabled)
इस विकल्प से यह तय किया जाता है कि जवाब देने वाले व्यक्ति के फ़ॉर्म पूरा करने के बाद, फ़ॉर्म में एक और जवाब सबमिट करने का लिंक दिखेगा या नहीं. नए फ़ॉर्म के लिए डिफ़ॉल्ट सेटिंग true है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
enabled | Boolean | true अगर फ़ॉर्म में "दूसरा जवाब सबमिट करें" लिंक दिखाना है, तो false अगर नहीं. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setShuffleQuestions(shuffle)
इस कुकी से यह तय होता है कि फ़ॉर्म के हर पेज पर सवालों का क्रम रैंडम किया गया है या नहीं.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
shuffle | Boolean | true अगर फ़ॉर्म के हर पेज पर सवालों का क्रम रैंडम होना चाहिए; false अगर नहीं. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
setTitle(title)
इससे फ़ॉर्म का टाइटल सेट किया जाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
title | String | फ़ॉर्म का नया टाइटल. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
shortenFormUrl(url)
यह फ़ंक्शन, फ़ॉर्म के लंबे यूआरएल को छोटे यूआरएल में बदलता है. अगर लंबा यूआरएल, Google Forms का नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
url | String | छोटा किया जाने वाला यूआरएल. |
वापसी का टिकट
String — http://goo.gl/forms/1234 के फ़ॉर्मैट में यूआरएल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
submitGrades(responses)
यह फ़ंक्शन, दी गई FormResponses के लिए ग्रेड सबमिट करता है.
अगर आपके कोड में onFormSubmit ट्रिगर शामिल है, तो submitGrades() को कॉल करने से onFormSubmit की शर्त ट्रिगर हो जाती है और एक इनफ़िनिट लूप बन जाता है. इनफ़िनिट लूप को रोकने के लिए, ऐसा कोड जोड़ें जो submitGrades() को कॉल करने से पहले यह जांच करे कि ग्रेड पहले से मौजूद हैं या नहीं.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
responses | Form | फ़ॉर्म में मिले सभी जवाबों का कलेक्शन. |
वापसी का टिकट
Form — यह Form, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
supportsAdvancedResponderPermissions()
यह कुकी तय करती है कि फ़ॉर्म को पब्लिश किया जा सकता है या नहीं. इस तरीके का इस्तेमाल यह तय करने के लिए किया जाता है कि setPublished(enabled) और isPublished() तरीके और जवाब देने वाले की अनुमतियां उपलब्ध हैं या नहीं.
// 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());
वापसी का टिकट
Boolean — अगर फ़ॉर्म पब्लिश करने की सुविधा के साथ काम करता है, तो true; अगर नहीं, तो false.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms