Google Sheets की फ़ाइलों को ऐक्सेस और उनमें बदलाव करना. आम तौर पर, नई शीट जोड़ना और सहयोगी जोड़ना जैसे ऑपरेशन किए जाते हैं.
तरीके
| तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
|---|---|---|
add | Spreadsheet | यह फ़ंक्शन, सबसे ऊपर के लेवल की स्प्रेडशीट में, तय की गई कुंजी के साथ डेवलपर मेटाडेटा जोड़ता है. |
add | Spreadsheet | यह फ़ंक्शन, स्प्रेडशीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और दिखने की सेटिंग होती है. |
add | Spreadsheet | यह फ़ंक्शन, स्प्रेडशीट में दी गई कुंजी और वैल्यू के साथ डेवलपर मेटाडेटा जोड़ता है. |
add | Spreadsheet | यह फ़ंक्शन, स्प्रेडशीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी, वैल्यू, और दिखने की सेटिंग शामिल होती है. |
add | Spreadsheet | यह फ़ंक्शन, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ता है. |
add | Spreadsheet | यह फ़ंक्शन, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ता है. |
add | Spreadsheet | यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Spreadsheet के लिए संपादकों की सूची में जोड़ता है. |
add | void | इससे स्प्रेडशीट के यूज़र इंटरफ़ेस (यूआई) में एक नया मेन्यू बनता है. |
add | Spreadsheet | इस फ़ंक्शन का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है. |
add | Spreadsheet | इस फ़ंक्शन का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है. |
add | Spreadsheet | यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Spreadsheet के दर्शकों की सूची में जोड़ता है. |
append | Sheet | यह फ़ंक्शन, शीट में मौजूद मौजूदा डेटा क्षेत्र की सबसे नीचे वाली लाइन में एक नई लाइन जोड़ता है. |
auto | Sheet | इससे दिए गए कॉलम की चौड़ाई को उसके कॉन्टेंट के हिसाब से सेट किया जाता है. |
copy(name) | Spreadsheet | यह फ़ंक्शन, स्प्रेडशीट की कॉपी बनाता है और नई स्प्रेडशीट दिखाता है. |
create | Developer | यह फ़ंक्शन, इस स्प्रेडशीट के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए Developer दिखाता है. |
create | Text | यह स्प्रेडशीट के लिए टेक्स्ट फ़ाइंडर बनाता है. इसका इस्तेमाल स्प्रेडशीट में टेक्स्ट ढूंढने और बदलने के लिए किया जा सकता है. |
delete | Sheet | इससे मौजूदा शीट मिट जाती है. |
delete | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन पर मौजूद कॉलम को मिटाता है. |
delete | void | यह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले कॉलम की संख्या को मिटाता है. |
delete | Sheet | यह फ़ंक्शन, दी गई लाइन की पोज़िशन पर मौजूद लाइन को मिटाता है. |
delete | void | यह फ़ंक्शन, दी गई लाइन की पोज़िशन से शुरू होने वाली कई लाइनों को मिटाता है. |
delete | void | इस फ़ंक्शन का इस्तेमाल, बताई गई शीट को मिटाने के लिए किया जाता है. |
duplicate | Sheet | इस फ़ंक्शन से, ऐक्टिव शीट की डुप्लीकेट कॉपी बन जाती है और उसे ऐक्टिव शीट के तौर पर सेट कर दिया जाता है. |
get | Range | यह फ़ंक्शन, इस शीट में मौजूद ऐक्टिव सेल दिखाता है. |
get | Range | यह फ़ंक्शन, चालू शीट में चुनी गई रेंज दिखाता है. अगर कोई रेंज चालू नहीं है, तो यह null दिखाता है. |
get | Range | यह फ़ंक्शन, ऐक्टिव शीट में मौजूद ऐक्टिव रेंज की सूची दिखाता है. अगर कोई ऐक्टिव रेंज मौजूद नहीं है, तो यह null दिखाता है. |
get | Sheet | यह फ़ंक्शन, स्प्रेडशीट में मौजूद ऐक्टिव शीट को दिखाता है. |
get | Blob | इस ऑब्जेक्ट में मौजूद डेटा को, बताए गए कॉन्टेंट टाइप में बदले गए ब्लॉब के तौर पर दिखाता है. |
get | Banding[] | यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद सभी बैंडिंग दिखाता है. |
get | Blob | इस ऑब्जेक्ट में मौजूद डेटा को blob के तौर पर दिखाओ. |
get | Integer | यह फ़ंक्शन, दी गई कॉलम की चौड़ाई को पिक्सल में दिखाता है. |
get | Range|null | यह फ़ंक्शन, ऐक्टिव शीट में मौजूद मौजूदा सेल या null दिखाता है. अगर कोई मौजूदा सेल नहीं है, तो यह फ़ंक्शन null दिखाता है. |
get | Range | यह फ़ंक्शन, उन डाइमेंशन के लिए Range दिखाता है जिनमें डेटा मौजूद है. |
get | Data | इससे डेटा सोर्स के सभी फ़ॉर्मूले मिलते हैं. |
get | Data | इससे डेटा सोर्स की सभी पिवट टेबल मिलती हैं. |
get | Data | इस स्प्रेडशीट के रीफ़्रेश शेड्यूल मिलते हैं. |
get | Data | यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स शीट दिखाता है. |
get | Data | इससे डेटा सोर्स की सभी टेबल मिलती हैं. |
get | Data | यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स दिखाता है. |
get | Developer | यह टॉप-लेवल की स्प्रेडशीट से जुड़ा डेवलपर मेटाडेटा दिखाता है. |
get | User[] | इस Spreadsheet के लिए एडिटर की सूची मिलती है. |
get | String | यह फ़ंक्शन, उस फ़ॉर्म का यूआरएल दिखाता है जिसके जवाब इस स्प्रेडशीट में भेजे जाते हैं. अगर इस स्प्रेडशीट से कोई फ़ॉर्म नहीं जुड़ा है, तो यह null दिखाता है. |
get | Integer | फ़्रीज़ किए गए कॉलम की संख्या दिखाता है. |
get | Integer | इस फ़ंक्शन की मदद से, फ़्रीज़ की गई पंक्तियों की संख्या मिलती है. |
get | String | इस स्प्रेडशीट के लिए यूनीक आइडेंटिफ़ायर मिलता है. |
get | Over | यह फ़ंक्शन, शीट पर मौजूद सभी ओवर-द-ग्रिड इमेज दिखाता है. |
get | Number | यह फ़ंक्शन, बार-बार की जाने वाली कैलकुलेशन के दौरान इस्तेमाल की गई थ्रेशोल्ड वैल्यू दिखाता है. |
get | Integer | यह फ़ंक्शन, कॉन्टेंट वाले आखिरी कॉलम की पोज़िशन दिखाता है. |
get | Integer | कॉन्टेंट वाली आखिरी लाइन की पोज़िशन दिखाता है. |
get | Integer | यह फ़ंक्शन, इटरेटिव कैलकुलेशन के दौरान इस्तेमाल किए जाने वाले ज़्यादा से ज़्यादा इटरेशन की संख्या दिखाता है. |
get | String | इससे दस्तावेज़ का नाम मिलता है. |
get | Named | इस स्प्रेडशीट में मौजूद सभी नेम रेंज को दिखाता है. |
get | Integer | यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद शीट की संख्या दिखाता है. |
get | User | यह फ़ंक्शन, दस्तावेज़ के मालिक का नाम दिखाता है. अगर दस्तावेज़, शेयर की गई ड्राइव में है, तो यह null दिखाता है. |
get | Spreadsheet | पहले से तय की गई थीम की सूची दिखाता है. |
get | Protection[] | यह फ़ंक्शन, स्प्रेडशीट में सुरक्षित की गई सभी रेंज या शीट को दिखाने वाले ऑब्जेक्ट की एक कैटगरी दिखाता है. |
get | Range | यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताई गई रेंज दिखाता है. |
get | Range | यह फ़ंक्शन, किसी नाम वाली रेंज दिखाता है. अगर दिए गए नाम वाली कोई रेंज नहीं मिलती है, तो यह null दिखाता है. |
get | Range | यह फ़ंक्शन, Range कलेक्शन दिखाता है. यह कलेक्शन, उसी शीट में मौजूद उन रेंज को दिखाता है जिन्हें A1 नोटेशन या R1C1 नोटेशन की ऐसी सूची से तय किया गया है जो खाली नहीं है. |
get | Recalculation | यह फ़ंक्शन, इस स्प्रेडशीट के लिए कैलकुलेशन इंटरवल दिखाता है. |
get | Integer | यह तरीका, दी गई लाइन की ऊंचाई को पिक्सल में दिखाता है. |
get | Selection | यह फ़ंक्शन, स्प्रेडशीट में मौजूद मौजूदा Selection दिखाता है. |
get | Sheet|null | इस फ़ंक्शन से, दिए गए आईडी वाली शीट मिलती है. |
get | Sheet|null | यह फ़ंक्शन, दिए गए नाम वाली शीट दिखाता है. |
get | Integer | यह फ़ंक्शन, इस ऑब्जेक्ट से दिखाई गई शीट का आईडी दिखाता है. |
get | String | यह फ़ंक्शन, शीट का नाम दिखाता है. |
get | Object[][] | यह फ़ंक्शन, दिए गए कोऑर्डिनेट से शुरू होने वाली इस रेंज के लिए, वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है. |
get | Sheet[] | यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद सभी शीट को दिखाता है. |
get | String | यह स्प्रेडशीट का स्थान-भाषा कोड दिखाता है. |
get | Spreadsheet | यह फ़ंक्शन, स्प्रेडशीट की मौजूदा थीम दिखाता है. अगर कोई थीम लागू नहीं की गई है, तो यह null दिखाता है. |
get | String | स्प्रेडशीट के टाइम ज़ोन की जानकारी मिलती है. |
get | String | यह फ़ंक्शन, दी गई स्प्रेडशीट के लिए यूआरएल दिखाता है. |
get | User[] | इस Spreadsheet के लिए, दर्शकों और टिप्पणी करने वालों की सूची मिलती है. |
hide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को छिपाता है. |
hide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों को छिपाता है. |
insert | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद एक कॉलम जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई कॉलम पोज़िशन से पहले एक कॉलम जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद, तय किए गए कॉलम की संख्या को जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन से पहले कई कॉलम जोड़ता है. |
insert | Data | यह स्प्रेडशीट में एक नया Data जोड़ता है और डेटा को प्रोसेस करना शुरू करता है. |
insert | Over | यह फ़ंक्शन, किसी दस्तावेज़ में दी गई पंक्ति और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है. |
insert | Over | यह फ़ंक्शन, किसी दस्तावेज़ में दी गई लाइन और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है. साथ ही, इसमें पिक्सल ऑफ़सेट भी शामिल होता है. |
insert | Over | दस्तावेज़ में किसी दी गई पंक्ति और कॉलम में इमेज डालता है. |
insert | Over | यह फ़ंक्शन, दस्तावेज़ में किसी इमेज को तय की गई लाइन और कॉलम में पिक्सल ऑफ़सेट के साथ जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद एक पंक्ति जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले एक पंक्ति जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद कई पंक्तियां जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले कई पंक्तियां जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, स्प्रेडशीट में डिफ़ॉल्ट शीट के नाम का इस्तेमाल करके नई शीट जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर एक नई शीट जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई इंडेक्स वैल्यू के हिसाब से स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, इसमें वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है. |
insert | Sheet | यह फ़ंक्शन, स्प्रेडशीट में नई शीट जोड़ता है. इसके लिए, शीट के डिफ़ॉल्ट नाम और वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जाता है. |
insert | Sheet | यह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर, दिए गए नाम की नई शीट जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, स्प्रैडशीट में दी गई इंडेक्स वैल्यू पर दिए गए नाम की नई शीट जोड़ता है. साथ ही, यह ज़रूरत के हिसाब से ऐडवांस आर्ग्युमेंट का इस्तेमाल करता है. |
insert | Sheet | यह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है. साथ ही, इसमें ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है. |
insert | Sheet | यह स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, दिए गए डेटा सोर्स स्पेसिफ़िकेशन के साथ पूरी शीट में फ़ैला हुआ Data बनाता है और डेटा को प्रोसेस करना शुरू करता है. |
is | Boolean | यह फ़ंक्शन बताता है कि उपयोगकर्ता ने दी गई कॉलम को छिपाया है या नहीं. |
is | Boolean | यह फ़ंक्शन बताता है कि इस स्प्रेडशीट में इटरेटिव कैलकुलेशन चालू है या नहीं. |
is | Boolean | यह फ़ंक्शन बताता है कि दी गई लाइन को फ़िल्टर (फ़िल्टर व्यू नहीं) की मदद से छिपाया गया है या नहीं. |
is | Boolean | इससे यह पता चलता है कि दी गई लाइन को उपयोगकर्ता ने छिपाया है या नहीं. |
move | void | इस फ़ंक्शन की मदद से, चालू शीट को शीट की सूची में दी गई जगह पर ले जाया जाता है. |
move | Sheet | यह फ़ंक्शन, नई Sheet शीट बनाता है और दिए गए चार्ट को उसमें ले जाता है. |
refresh | void | यह सुविधा, काम करने वाले सभी डेटा सोर्स और उनसे लिंक किए गए डेटा सोर्स ऑब्जेक्ट को रीफ़्रेश करती है. साथ ही, अमान्य डेटा सोर्स ऑब्जेक्ट को छोड़ देती है. |
remove | Spreadsheet | इस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के एडिटर की सूची से हटा दिया जाता है. |
remove | Spreadsheet | इस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के एडिटर की सूची से हटा दिया जाता है. |
remove | void | add से जोड़े गए मेन्यू को हटाता है. |
remove | void | इस फ़ंक्शन का इस्तेमाल करके, दिए गए नाम वाली रेंज को मिटाया जा सकता है. |
remove | Spreadsheet | इस फ़ंक्शन का इस्तेमाल करके, किसी उपयोगकर्ता को Spreadsheet के दर्शकों और टिप्पणीकारों की सूची से हटाया जा सकता है. |
remove | Spreadsheet | इस फ़ंक्शन का इस्तेमाल करके, किसी उपयोगकर्ता को Spreadsheet के दर्शकों और टिप्पणीकारों की सूची से हटाया जा सकता है. |
rename(newName) | void | दस्तावेज़ का नाम बदलता है. |
rename | void | इस फ़ंक्शन की मदद से, मौजूदा चालू शीट का नाम बदलकर नया नाम रखा जा सकता है. |
reset | Spreadsheet | यह फ़ंक्शन, स्प्रेडशीट पर लागू की गई थीम को हटाता है और डिफ़ॉल्ट थीम सेट करता है. |
set | Range | यह फ़ंक्शन, चुनी गई रेंज को चालू शीट में active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर मौजूद बाएं सेल को current cell के तौर पर सेट करता है. |
set | Range | यह फ़ंक्शन, रेंज की दी गई सूची को ऐक्टिव शीट में active ranges के तौर पर सेट करता है. |
set | Range | इस शीट के लिए, चुने गए सेल की रेंज सेट करता है. |
set | Range | यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताए गए तरीके से, ऐक्टिव सेल को चुनता है. |
set | Sheet | यह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है. |
set | Sheet | यह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है. साथ ही, उस शीट में सबसे हाल ही में किए गए चुनाव को वापस लाने का विकल्प देता है. |
set | Sheet | इससे, दिए गए कॉलम की चौड़ाई पिक्सल में सेट होती है. |
set | Range | यह फ़ंक्शन, तय की गई सेल को current cell के तौर पर सेट करता है. |
set | void | इससे, दी गई संख्या के हिसाब से कॉलम फ़्रीज़ हो जाते हैं. |
set | void | दी गई पंक्तियों की संख्या को फ़्रीज़ करता है. |
set | Spreadsheet | यह विकल्प, बार-बार होने वाली कैलकुलेशन के लिए कम से कम थ्रेशोल्ड वैल्यू सेट करता है. |
set | Spreadsheet | इस स्प्रेडशीट में इटरेटिव कैलकुलेशन की सुविधा चालू है या नहीं, यह सेट करता है. |
set | Spreadsheet | इससे कैलकुलेशन के दोहराव की ज़्यादा से ज़्यादा संख्या सेट की जाती है. यह संख्या, कैलकुलेशन के दोहराव के दौरान इस्तेमाल की जाती है. |
set | void | किसी रेंज को नाम देता है. |
set | Spreadsheet | इससे यह तय होता है कि इस स्प्रेडशीट को कितनी बार फिर से कैलकुलेट करना चाहिए. |
set | Sheet | यह विकल्प, दी गई लाइन की ऊंचाई को पिक्सल में सेट करता है. |
set | void | स्प्रेडशीट की भाषा सेट करता है. |
set | Spreadsheet | इस फ़ंक्शन का इस्तेमाल करके, स्प्रेडशीट में थीम सेट की जाती है. |
set | void | यह विकल्प, स्प्रेडशीट के लिए टाइम ज़ोन सेट करता है. |
show(userInterface) | void | यह फ़ंक्शन, उपयोगकर्ता के ब्राउज़र के व्यूपोर्ट के बीच में मौजूद डायलॉग में, कस्टम यूज़र इंटरफ़ेस कॉम्पोनेंट दिखाता है. |
sort(columnPosition) | Sheet | यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से बढ़ते क्रम में लगाता है. |
sort(columnPosition, ascending) | Sheet | यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से क्रम में लगाता है. |
toast(msg) | void | यह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में, दिए गए मैसेज के साथ एक पॉप-अप विंडो दिखाता है. |
toast(msg, title) | void | यह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में एक पॉप-अप विंडो दिखाता है. इसमें दिया गया मैसेज और टाइटल दिखता है. |
toast(msg, title, timeoutSeconds) | void | यह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में एक पॉप-अप विंडो दिखाता है. इसमें दिया गया टाइटल और मैसेज होता है. यह विंडो कुछ समय तक दिखती है. |
unhide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को दिखाता है. |
unhide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्ति को दिखाता है. |
update | void | add से जोड़े गए मेन्यू को अपडेट करता है. |
wait | void | यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी मौजूदा एक्ज़ीक्यूशन के पूरा होने तक इंतज़ार करता है. साथ ही, तय किए गए सेकंड के बाद टाइम आउट हो जाता है. |
ज़्यादा जानकारी वाला दस्तावेज़
addDeveloperMetadata(key)
यह फ़ंक्शन, सबसे ऊपर के लेवल की स्प्रेडशीट में, तय की गई कुंजी के साथ डेवलपर मेटाडेटा जोड़ता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Adds the key 'NAME' in the developer metadata for the spreadsheet. ss.addDeveloperMetadata('NAME'); // Gets the first developer metadata object and logs its key. const developerMetaData = ss.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addDeveloperMetadata(key, visibility)
यह फ़ंक्शन, स्प्रेडशीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और दिखने की सेटिंग होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Adds the key 'NAME' in the developer metadata for the spreadsheet and sets // the visibility to the developer project that created the metadata. ss.addDeveloperMetadata( 'NAME', SpreadsheetApp.DeveloperMetadataVisibility.PROJECT, ); // Gets the first developer metadata object and logs its key and visibility // setting. const developerMetaData = ss.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(`Key: ${developerMetaData.getKey()}, . Visibility: ${developerMetaData.getVisibility()}`);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
visibility | Developer | नए डेवलपर मेटाडेटा के दिखने की स्थिति. |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addDeveloperMetadata(key, value)
यह फ़ंक्शन, स्प्रेडशीट में दी गई कुंजी और वैल्यू के साथ डेवलपर मेटाडेटा जोड़ता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Adds the key 'NAME' and sets the value to 'GOOGLE' in the developer metadata // for the spreadsheet. ss.addDeveloperMetadata('NAME', 'GOOGLE'); // Gets the first developer metadata object and logs its key and value. const developerMetaData = ss.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log( `Key: ${developerMetaData.getKey()}, Value: ${ developerMetaData.getValue()}`, );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addDeveloperMetadata(key, value, visibility)
यह फ़ंक्शन, स्प्रेडशीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी, वैल्यू, और दिखने की सेटिंग शामिल होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Adds the key 'NAME', sets the value to 'GOOGLE', and sets the visibility // to any developer project with document access. ss.addDeveloperMetadata( 'NAME', 'GOOGLE', SpreadsheetApp.DeveloperMetadataVisibility.DOCUMENT, ); // Gets the first developer metadata object and logs its key, value, and // visibility setting. const developerMetaData = ss.getDeveloperMetadata()[0]; console.log(`Key: ${developerMetaData.getKey()}, Value: ${developerMetaData.getValue()}, Visibility: ${developerMetaData.getVisibility()}`);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
visibility | Developer | नए डेवलपर मेटाडेटा के दिखने की स्थिति. |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addEditor(emailAddress)
यह फ़ंक्शन, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ता है. अगर उपयोगकर्ता पहले से ही दर्शकों की सूची में शामिल था, तो यह तरीका उपयोगकर्ता को दर्शकों की सूची से हटा देता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | जिस उपयोगकर्ता को जोड़ना है उसका ईमेल पता. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addEditor(user)
यह फ़ंक्शन, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ता है. अगर उपयोगकर्ता पहले से ही दर्शकों की सूची में शामिल था, तो यह तरीका उपयोगकर्ता को दर्शकों की सूची से हटा देता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | जोड़े जाने वाले उपयोगकर्ता का प्रतिनिधित्व. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addEditors(emailAddresses)
यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Spreadsheet के लिए संपादकों की सूची में जोड़ता है. अगर कोई उपयोगकर्ता पहले से ही दर्शकों की सूची में शामिल है, तो इस तरीके से उसे दर्शकों की सूची से हटा दिया जाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String[] | जोड़े जाने वाले उपयोगकर्ताओं के ईमेल पतों की एक कैटगरी. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addMenu(name, subMenus)
इससे स्प्रेडशीट के यूज़र इंटरफ़ेस (यूआई) में एक नया मेन्यू बनता है.
हर मेन्यू एंट्री, उपयोगकर्ता के तय किए गए फ़ंक्शन को चलाती है. आम तौर पर, इसे onOpen() फ़ंक्शन से कॉल किया जाता है, ताकि स्प्रेडशीट लोड होने पर मेन्यू अपने-आप बन जाए.
// The onOpen function is executed automatically every time a Spreadsheet is // loaded function onOpen() { const ss = SpreadsheetApp.getActiveSpreadsheet(); const menuEntries = []; // When the user clicks on "addMenuExample" then "Menu Entry 1", the function // function1 is executed. menuEntries.push({name: 'Menu Entry 1', functionName: 'function1'}); menuEntries.push(null); // line separator menuEntries.push({name: 'Menu Entry 2', functionName: 'function2'}); ss.addMenu('addMenuExample', menuEntries); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | बनाए जाने वाले मेन्यू का नाम. |
sub | Object[] | name और function पैरामीटर वाले JavaScript मैप का कलेक्शन. इसमें शामिल लाइब्रेरी के फ़ंक्शन इस्तेमाल किए जा सकते हैं. जैसे,
Library.libFunction1. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addViewer(emailAddress)
इस फ़ंक्शन का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही संपादकों की सूची में शामिल है, तो इस तरीके का कोई असर नहीं होगा.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | जिस उपयोगकर्ता को जोड़ना है उसका ईमेल पता. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addViewer(user)
इस फ़ंक्शन का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही संपादकों की सूची में शामिल है, तो इस तरीके का कोई असर नहीं होगा.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | जोड़े जाने वाले उपयोगकर्ता का प्रतिनिधित्व. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addViewers(emailAddresses)
यह फ़ंक्शन, उपयोगकर्ताओं के दिए गए ऐरे को Spreadsheet के दर्शकों की सूची में जोड़ता है. अगर कोई उपयोगकर्ता पहले से ही संपादकों की सूची में शामिल है, तो इस तरीके का उस पर कोई असर नहीं पड़ेगा.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String[] | जोड़े जाने वाले उपयोगकर्ताओं के ईमेल पतों की एक कैटगरी. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
appendRow(rowContents)
यह फ़ंक्शन, शीट में मौजूद मौजूदा डेटा क्षेत्र की सबसे नीचे वाली लाइन में एक नई लाइन जोड़ता है. अगर किसी सेल का कॉन्टेंट = से शुरू होता है, तो उसे फ़ॉर्मूला माना जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Appends a new row with 3 columns to the bottom of the current // data region in the sheet containing the values in the array. sheet.appendRow(['a man', 'a plan', 'panama']);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Object[] | शीट की आखिरी लाइन के बाद डाली जाने वाली वैल्यू का ऐरे. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
autoResizeColumn(columnPosition)
इससे दिए गए कॉलम की चौड़ाई को उसके कॉन्टेंट के हिसाब से सेट किया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.getRange('a1').setValue( 'Whenever it is a damp, drizzly November in my soul...'); // Sets the first column to a width which fits the text sheet.autoResizeColumn(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | आकार बदलने के लिए, दिए गए कॉलम की पोज़िशन. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
copy(name)
यह फ़ंक्शन, स्प्रेडशीट की कॉपी बनाता है और नई स्प्रेडशीट दिखाता है.
// This code makes a copy of the current spreadsheet and names it appropriately const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.copy(`Copy of ${ss.getName()}`);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | कॉपी का नाम. |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
createDeveloperMetadataFinder()
यह फ़ंक्शन, इस स्प्रेडशीट के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए DeveloperMetadataFinder दिखाता है. डिफ़ॉल्ट रूप से, यह स्प्रेडशीट, शीट, लाइनों, और कॉलम से जुड़े सभी मेटाडेटा को ध्यान में रखता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Adds developer metadata to the spreadsheet. ss.addDeveloperMetadata('NAME', 'CHARLIE'); ss.addDeveloperMetadata('COMPANY', 'EXAMPLE ORGANIZATION'); ss.addDeveloperMetadata('TECHNOLOGY', 'JAVASCRIPT'); // Creates a developer metadata finder. const developerMetadataFinder = ss.createDeveloperMetadataFinder(); // Finds the developer metadata objects with 'COMPANY' as the key. const googleMetadataFromSpreadsheet = developerMetadataFinder.withKey('COMPANY').find(); // Gets the first result of developer metadata that has the key 'COMPANY' and // logs its value. console.log(googleMetadataFromSpreadsheet[0].getValue());
वापसी का टिकट
DeveloperMetadataFinder — यह डेवलपर मेटाडेटा फ़ाइंडर है. इसकी मदद से, इस स्प्रेडशीट के दायरे में मेटाडेटा खोजा जा सकता है.
createTextFinder(findText)
यह स्प्रेडशीट के लिए टेक्स्ट फ़ाइंडर बनाता है. इसका इस्तेमाल स्प्रेडशीट में टेक्स्ट ढूंढने और बदलने के लिए किया जा सकता है. खोज, स्प्रेडशीट की पहली शीट से शुरू होती है.
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // Creates a text finder. const textFinder = spreadsheet.createTextFinder('dog'); // Returns the first occurrence of 'dog' in the spreadsheet. const firstOccurrence = textFinder.findNext(); // Replaces the last found occurrence of 'dog' with 'cat' and returns the number // of occurrences replaced. const numOccurrencesReplaced = textFinder.replaceWith('cat');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
find | String | वह टेक्स्ट जिसे खोजना है. |
वापसी का टिकट
TextFinder — स्प्रेडशीट के लिए TextFinder.
deleteActiveSheet()
इससे मौजूदा शीट मिट जाती है.
// The code below deletes the currently active sheet and stores the new active // sheet in a variable const newSheet = SpreadsheetApp.getActiveSpreadsheet().deleteActiveSheet();
वापसी का टिकट
Sheet — नई ऐक्टिव शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
deleteColumn(columnPosition)
यह फ़ंक्शन, कॉलम की दी गई पोज़िशन पर मौजूद कॉलम को मिटाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Columns start at "1" - this deletes the first column sheet.deleteColumn(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | कॉलम की पोज़िशन. पहले कॉलम के लिए, इसकी वैल्यू 1 से शुरू होती है. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
deleteColumns(columnPosition, howMany)
यह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले कॉलम की संख्या को मिटाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Columns start at "1" - this deletes the first two columns sheet.deleteColumns(1, 2);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | मिटाए जाने वाले पहले कॉलम की पोज़िशन. |
how | Integer | मिटाए जाने वाले कॉलम की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
deleteRow(rowPosition)
यह फ़ंक्शन, दी गई लाइन की पोज़िशन पर मौजूद लाइन को मिटाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Rows start at "1" - this deletes the first row sheet.deleteRow(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | लाइन की पोज़िशन. पहली लाइन के लिए, इसकी वैल्यू 1 से शुरू होती है. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
deleteRows(rowPosition, howMany)
यह फ़ंक्शन, दी गई लाइन की पोज़िशन से शुरू होने वाली कई लाइनों को मिटाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Rows start at "1" - this deletes the first two rows sheet.deleteRows(1, 2);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | मिटाई जाने वाली पहली लाइन की पोज़िशन. |
how | Integer | मिटाई जाने वाली लाइनों की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
deleteSheet(sheet)
इस फ़ंक्शन का इस्तेमाल, बताई गई शीट को मिटाने के लिए किया जाता है.
// The code below deletes the specified sheet. const ss = SpreadsheetApp.getActive(); const sheet = ss.getSheetByName('My Sheet'); ss.deleteSheet(sheet);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | Sheet | वह शीट जिसे मिटाना है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
duplicateActiveSheet()
इस फ़ंक्शन से, ऐक्टिव शीट की डुप्लीकेट कॉपी बन जाती है और उसे ऐक्टिव शीट के तौर पर सेट कर दिया जाता है.
// The code below makes a duplicate of the active sheet SpreadsheetApp.getActiveSpreadsheet().duplicateActiveSheet();
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getActiveCell()
यह फ़ंक्शन, इस शीट में मौजूद ऐक्टिव सेल दिखाता है.
ध्यान दें: getCurrentCell() का इस्तेमाल करना बेहतर होता है. यह फ़ंक्शन, हाइलाइट की गई मौजूदा सेल की वैल्यू दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Returns the active cell const cell = sheet.getActiveCell();
वापसी का टिकट
Range — यह मौजूदा ऐक्टिव सेल है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getActiveRange()
यह फ़ंक्शन, चालू शीट में चुनी गई रेंज दिखाता है. अगर कोई रेंज चालू नहीं है, तो यह null दिखाता है. अगर एक से ज़्यादा रेंज चुनी जाती हैं, तो यह तरीका सिर्फ़ आखिरी चुनी गई रेंज दिखाता है.
"ऐक्टिव रेंज" का मतलब उस रेंज से है जिसे उपयोगकर्ता ने ऐक्टिव शीट में चुना है. हालांकि, कस्टम फ़ंक्शन में इसका मतलब उस सेल से है जिसकी वैल्यू को फिर से कैलकुलेट किया जा रहा है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); const activeRange = sheet.getActiveRange();
वापसी का टिकट
Range — ऐक्टिव रेंज.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
getActiveRangeList()
यह फ़ंक्शन, ऐक्टिव शीट में मौजूद ऐक्टिव रेंज की सूची दिखाता है. अगर कोई ऐक्टिव रेंज मौजूद नहीं है, तो यह null दिखाता है.
अगर सिर्फ़ एक रेंज चुनी गई है, तो यह getActiveRange() कॉल की तरह काम करता है.
const sheet = SpreadsheetApp.getActiveSheet(); // Returns the list of active ranges. const activeRangeList = sheet.getActiveRangeList();
वापसी का टिकट
RangeList|null — ऐक्टिव रेंज की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
getActiveSheet()
यह फ़ंक्शन, स्प्रेडशीट में मौजूद ऐक्टिव शीट को दिखाता है.
स्प्रेडशीट में ऐक्टिव शीट वह शीट होती है जो स्प्रेडशीट के यूज़र इंटरफ़ेस (यूआई) में दिख रही होती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
वापसी का टिकट
Sheet — स्प्रेडशीट में मौजूद ऐक्टिव शीट.
getAs(contentType)
इस ऑब्जेक्ट में मौजूद डेटा को, बताए गए कॉन्टेंट टाइप में बदले गए ब्लॉब के तौर पर दिखाता है. इस तरीके से, फ़ाइल के नाम में सही एक्सटेंशन जुड़ जाता है. उदाहरण के लिए, "myfile.pdf". हालांकि, यह मानता है कि फ़ाइल नाम का वह हिस्सा जो आखिरी अवधि के बाद आता है (अगर कोई हो), एक मौजूदा एक्सटेंशन है जिसे बदला जाना चाहिए. इसलिए, "ShoppingList.12.25.2014" बदलकर "ShoppingList.12.25.pdf" हो जाता है.
कन्वर्ज़न के लिए रोज़ाना के कोटा देखने के लिए, Google की सेवाओं के लिए कोटा देखें. नए Google Workspace डोमेन पर, कुछ समय के लिए ज़्यादा पाबंदियां लागू हो सकती हैं.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
content | String | जिस MIME टाइप में बदलना है. ज़्यादातर ब्लॉब के लिए, 'application/pdf' ही मान्य विकल्प है. BMP, GIF, JPEG या PNG फ़ॉर्मैट में मौजूद इमेज के लिए, 'image/bmp', 'image/gif', 'image/jpeg' या 'image/png' में से कोई भी एक मान्य है. Google Docs दस्तावेज़ के लिए, 'text/markdown' भी मान्य है. |
वापसी का टिकट
Blob — डेटा को एक बड़े बाइनरी ऑब्जेक्ट के तौर पर दिखाया जाता है.
getBandings()
यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद सभी बैंडिंग दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets an array of the bandings in the spreadsheet. const bandings = ss.getBandings(); // Logs the range of the first banding in the spreadsheet to the console. console.log(bandings[0].getRange().getA1Notation());
वापसी का टिकट
Banding[] — इस स्प्रेडशीट में मौजूद बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getBlob()
इस ऑब्जेक्ट में मौजूद डेटा को blob के तौर पर दिखाओ.
वापसी का टिकट
Blob — डेटा को एक बड़े बाइनरी ऑब्जेक्ट के तौर पर दिखाया जाता है.
getColumnWidth(columnPosition)
यह फ़ंक्शन, दी गई कॉलम की चौड़ाई को पिक्सल में दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Columns start at 1 Logger.log(sheet.getColumnWidth(1));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | जांच किए जाने वाले कॉलम की पोज़िशन. |
वापसी का टिकट
Integer — पिक्सल में कॉलम की चौड़ाई.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getCurrentCell()
यह फ़ंक्शन, ऐक्टिव शीट में मौजूद मौजूदा सेल या null दिखाता है. अगर कोई मौजूदा सेल नहीं है, तो यह फ़ंक्शन null दिखाता है. मौजूदा सेल, Google Sheets के यूज़र इंटरफ़ेस (यूआई) में फ़ोकस की गई सेल होती है. इसे गहरे रंग के बॉर्डर से हाइलाइट किया जाता है. एक समय में सिर्फ़ एक ही सेल चालू होती है. जब कोई उपयोगकर्ता एक या उससे ज़्यादा सेल रेंज चुनता है, तो चुनी गई सेल में से कोई एक सेल, मौजूदा सेल होती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); // Returns the current highlighted cell in the one of the active ranges. const currentCell = sheet.getCurrentCell();
वापसी का टिकट
Range|null — मौजूदा सेल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataRange()
यह फ़ंक्शन, उन डाइमेंशन के लिए Range दिखाता है जिनमें डेटा मौजूद है.
यह फ़ंक्शन, A1 और (Sheet.getLastColumn(), Sheet.getLastRow()) से बंधी हुई रेंज बनाने जैसा है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This represents ALL the data const range = sheet.getDataRange(); const values = range.getValues(); // This logs the spreadsheet in CSV format with a trailing comma for (let i = 0; i < values.length; i++) { let row = ''; for (let j = 0; j < values[i].length; j++) { if (values[i][j]) { row = row + values[i][j]; } row = `${row},`; } Logger.log(row); }
वापसी का टिकट
Range — यह एक ऐसी रेंज होती है जिसमें स्प्रेडशीट का पूरा डेटा शामिल होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceFormulas()
इससे डेटा सोर्स के सभी फ़ॉर्मूले मिलते हैं.
// Opens the spreadsheet by its ID. If you created your script from within a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets an array of the data source formulas on Sheet1. // To get an array of data source formulas for the entire spreadsheet, // replace 'sheet' with 'ss'. const dataSourceFormulas = sheet.getDataSourceFormulas(); // Logs the first data source formula in the array. console.log(dataSourceFormulas[0].getFormula());
वापसी का टिकट
DataSourceFormula[] — डेटा सोर्स के फ़ॉर्मूलों की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourcePivotTables()
इससे डेटा सोर्स की सभी पिवट टेबल मिलती हैं.
// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets an array of the data source pivot tables on Sheet1. // To get an array of data source pivot tables for the entire // spreadsheet, replace 'sheet' with 'ss'. const dataSourcePivotTables = sheet.getDataSourcePivotTables(); // Logs the last time that the first pivot table in the array was refreshed. console.log(dataSourcePivotTables[0].getStatus().getLastRefreshedTime());
वापसी का टिकट
DataSourcePivotTable[] — डेटा सोर्स की पिवट टेबल की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceRefreshSchedules()
इस स्प्रेडशीट के रीफ़्रेश शेड्यूल मिलते हैं.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Activates BigQuery operations for the connected spreadsheet. SpreadsheetApp.enableBigQueryExecution(); // Gets the frequency type of the first referesh schedule in the array. const frequencyType = ss.getDataSourceRefreshSchedules()[0] .getFrequency() .getFrequencyType() .toString(); // Logs the frequency type to the console. console.log(frequencyType);
वापसी का टिकट
DataSourceRefreshSchedule[] — इस स्प्रेडशीट को रीफ़्रेश करने के शेड्यूल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceSheets()
यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स शीट दिखाता है.
// Turns data execution on for BigQuery data sources. SpreadsheetApp.enableBigQueryExecution(); // Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets the first data source sheet in the spreadsheet. const dataSource = ss.getDataSourceSheets()[0]; // Gets the name of the data source sheet. console.log(dataSource.asSheet().getName());
वापसी का टिकट
DataSourceSheet[] — सभी डेटा सोर्स शीट की एक ऐरे.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceTables()
इससे डेटा सोर्स की सभी टेबल मिलती हैं.
// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets an array of data source tables on Sheet1. // To get an array of data source tables for the entire spreadsheet, // replace 'sheet' with 'ss'. const dataSourceTables = sheet.getDataSourceTables(); // Logs the last completed data execution time on the first data source table. console.log(dataSourceTables[0].getStatus().getLastExecutionTime());
वापसी का टिकट
DataSourceTable[] — डेटा सोर्स टेबल की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSources()
यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स दिखाता है.
// Turns data execution on for BigQuery data sources. SpreadsheetApp.enableBigQueryExecution(); // Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets the data sources on the spreadsheet. const dataSources = ss.getDataSources(); // Logs the name of the first column on the first data source. console.log(dataSources[0].getColumns()[0].getName());
वापसी का टिकट
DataSource[] — सभी डेटा सोर्स की एक ऐरे.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDeveloperMetadata()
यह टॉप-लेवल की स्प्रेडशीट से जुड़ा डेवलपर मेटाडेटा दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Adds 'Google' as a key to the spreadsheet metadata. ss.addDeveloperMetadata('Google'); // Gets the spreadsheet's metadata. const ssMetadata = ss.getDeveloperMetadata(); // Gets the first set of the spreadsheet's metadata and logs the key to the // console. console.log(ssMetadata[0].getKey());
वापसी का टिकट
DeveloperMetadata[] — इस रेंज से जुड़ा डेवलपर मेटाडेटा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getEditors()
इस Spreadsheet के लिए एडिटर की सूची मिलती है.
वापसी का टिकट
User[] — बदलाव करने की अनुमति वाले उपयोगकर्ताओं की एक सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFormUrl()
यह फ़ंक्शन, उस फ़ॉर्म का यूआरएल दिखाता है जिसके जवाब इस स्प्रेडशीट में भेजे जाते हैं. अगर इस स्प्रेडशीट से कोई फ़ॉर्म नहीं जुड़ा है, तो यह null दिखाता है. अगर कई फ़ॉर्म इस स्प्रेडशीट में जवाब भेजते हैं, तो फ़ॉर्म का यूआरएल तय नहीं किया जा सकता. इसके अलावा, हर शीट के लिए फ़ॉर्म यूआरएल के असोसिएशन, Sheet.getFormUrl() तरीके से वापस पाए जा सकते हैं. अगर उपयोगकर्ता के पास स्प्रेडशीट में बदलाव करने की अनुमति नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets the form URL from the spreadsheet. const formUrl = ss.getFormUrl(); // Logs the form URL to the console. console.log(formUrl);
वापसी का टिकट
String — यह उस फ़ॉर्म का यूआरएल होता है जिसके जवाब इस स्प्रेडशीट में सेव किए जाते हैं. अगर इस स्प्रेडशीट से कोई फ़ॉर्म नहीं जुड़ा है, तो इसकी वैल्यू null होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFrozenColumns()
फ़्रीज़ किए गए कॉलम की संख्या दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; Logger.log('Number of frozen columns: %s', sheet.getFrozenColumns());
वापसी का टिकट
Integer — फ़्रीज़ किए गए कॉलम की संख्या.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFrozenRows()
इस फ़ंक्शन की मदद से, फ़्रीज़ की गई पंक्तियों की संख्या मिलती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; Logger.log('Number of frozen rows: %s', sheet.getFrozenRows());
वापसी का टिकट
Integer — फ़्रीज़ की गई पंक्तियों की संख्या.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getId()
इस स्प्रेडशीट के लिए यूनीक आइडेंटिफ़ायर मिलता है. स्प्रेडशीट आईडी को उसके यूआरएल से निकाला जा सकता है. उदाहरण के लिए, यूआरएल https://docs.google.com/spreadsheets/d/abc1234567/edit#gid=0 में स्प्रेडशीट आईडी "abc1234567" है.
// The code below logs the ID for the active spreadsheet. Logger.log(SpreadsheetApp.getActiveSpreadsheet().getId());
वापसी का टिकट
String — स्प्रेडशीट के लिए यूनीक आईडी (या कुंजी).
getImages()
यह फ़ंक्शन, शीट पर मौजूद सभी ओवर-द-ग्रिड इमेज दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the over-the-grid images from Sheet1. // To get the over-the-grid images from the entire spreadsheet, use // ss.getImages() instead. const images = sheet.getImages(); // For each image, logs the anchor cell in A1 notation. for (const image of images) { console.log(image.getAnchorCell().getA1Notation()); }
वापसी का टिकट
OverGridImage[] — ओवर-द-ग्रिड इमेज का कलेक्शन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getIterativeCalculationConvergenceThreshold()
यह फ़ंक्शन, बार-बार की जाने वाली कैलकुलेशन के दौरान इस्तेमाल की गई थ्रेशोल्ड वैल्यू दिखाता है. जब लगातार की गई कैलकुलेशन के नतीजे इस वैल्यू से कम होते हैं, तो बार-बार की जाने वाली कैलकुलेशन बंद हो जाती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the iterative calculation convergence threshold for the spreadsheet. ss.setIterativeCalculationConvergenceThreshold(2); // Logs the threshold to the console. console.log(ss.getIterativeCalculationConvergenceThreshold());
वापसी का टिकट
Number — कन्वर्जेंस थ्रेशोल्ड.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getLastColumn()
यह फ़ंक्शन, कॉन्टेंट वाले आखिरी कॉलम की पोज़िशन दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This logs the value in the very last cell of this sheet const lastRow = sheet.getLastRow(); const lastColumn = sheet.getLastColumn(); const lastCell = sheet.getRange(lastRow, lastColumn); Logger.log(lastCell.getValue());
वापसी का टिकट
Integer — यह शीट का आखिरी कॉलम होता है, जिसमें कॉन्टेंट होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getLastRow()
कॉन्टेंट वाली आखिरी लाइन की पोज़िशन दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This logs the value in the very last cell of this sheet const lastRow = sheet.getLastRow(); const lastColumn = sheet.getLastColumn(); const lastCell = sheet.getRange(lastRow, lastColumn); Logger.log(lastCell.getValue());
वापसी का टिकट
Integer — यह शीट की आखिरी लाइन होती है, जिसमें कॉन्टेंट होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getMaxIterativeCalculationCycles()
यह फ़ंक्शन, इटरेटिव कैलकुलेशन के दौरान इस्तेमाल किए जाने वाले ज़्यादा से ज़्यादा इटरेशन की संख्या दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the max iterative calculation cycles for the spreadsheet. ss.setMaxIterativeCalculationCycles(10); // Logs the max iterative calculation cycles to the console. console.log(ss.getMaxIterativeCalculationCycles());
वापसी का टिकट
Integer — कैलकुलेशन के लिए ज़्यादा से ज़्यादा इटरेशन की संख्या.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getName()
इससे दस्तावेज़ का नाम मिलता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); Logger.log(ss.getName());
वापसी का टिकट
String — स्प्रेडशीट का नाम.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNamedRanges()
इस स्प्रेडशीट में मौजूद सभी नेम रेंज को दिखाता है.
// The code below logs the name of the first named range. const namedRanges = SpreadsheetApp.getActiveSpreadsheet().getNamedRanges(); for (let i = 0; i < namedRanges.length; i++) { Logger.log(namedRanges[i].getName()); }
वापसी का टिकट
NamedRange[] — स्प्रेडशीट में मौजूद सभी नाम वाली रेंज की एक कलेक्शन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNumSheets()
यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद शीट की संख्या दिखाता है.
// The code below logs the number of sheets in the active spreadsheet. Logger.log(SpreadsheetApp.getActiveSpreadsheet().getNumSheets());
वापसी का टिकट
Integer — स्प्रेडशीट में मौजूद शीट की संख्या.
getOwner()
यह फ़ंक्शन, दस्तावेज़ के मालिक का नाम दिखाता है. अगर दस्तावेज़, शेयर की गई ड्राइव में है, तो यह null दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const owner = ss.getOwner(); Logger.log(owner.getEmail());
वापसी का टिकट
User — दस्तावेज़ का मालिक या null, अगर दस्तावेज़ किसी शेयर की गई ड्राइव में है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getPredefinedSpreadsheetThemes()
पहले से तय की गई थीम की सूची दिखाता है.
// The code below returns the list of predefined themes. const predefinedThemesList = SpreadsheetApp.getActiveSpreadsheet().getPredefinedSpreadsheetThemes();
वापसी का टिकट
SpreadsheetTheme[] — पहले से तय की गई थीम की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getProtections(type)
यह फ़ंक्शन, स्प्रेडशीट में सुरक्षित की गई सभी रेंज या शीट को दिखाने वाले ऑब्जेक्ट की एक कैटगरी दिखाता है.
// Remove all range protections in the spreadsheet that the user has permission // to edit. const ss = SpreadsheetApp.getActive(); const protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); for (let i = 0; i < protections.length; i++) { const protection = protections[i]; if (protection.canEdit()) { protection.remove(); } }
// Remove all sheet protections in the spreadsheet that the user has permission // to edit. const ss = SpreadsheetApp.getActive(); const protections = ss.getProtections(SpreadsheetApp.ProtectionType.SHEET); for (let i = 0; i < protections.length; i++) { const protection = protections[i]; if (protection.canEdit()) { protection.remove(); } }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
type | Protection | संरक्षित क्षेत्र का टाइप, Spreadsheet या
Spreadsheet. |
वापसी का टिकट
Protection[] — यह ऑब्जेक्ट का एक ऐसा कलेक्शन होता है जो स्प्रेडशीट में सुरक्षित की गई सभी रेंज या शीट को दिखाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRange(a1Notation)
यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताई गई रेंज दिखाता है.
// Get a range A1:D4 on sheet titled "Invoices" const ss = SpreadsheetApp.getActiveSpreadsheet(); const range = ss.getRange('Invoices!A1:D4'); // Get cell A1 on the first sheet const sheet = ss.getSheets()[0]; const cell = sheet.getRange('A1');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
a1Notation | String | A1 नोटेशन या R1C1 नोटेशन में बताई गई वह रेंज जिसे वापस लाना है. |
वापसी का टिकट
Range — यह तय की गई जगह के लिए रेंज है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRangeByName(name)
यह फ़ंक्शन, किसी नाम वाली रेंज दिखाता है. अगर दिए गए नाम वाली कोई रेंज नहीं मिलती है, तो यह null दिखाता है. अगर स्प्रेडशीट की कई शीट में एक ही रेंज के नाम का इस्तेमाल किया जाता है, तो शीट का नाम बिना अतिरिक्त कोटेशन मार्क के डालें. उदाहरण के लिए, getRangeByName('TaxRates') या getRangeByName('Sheet Name!TaxRates'), लेकिन getRangeByName('"Sheet
Name"!TaxRates') नहीं.
// Log the number of columns for the range named 'TaxRates' in the active // spreadsheet. const range = SpreadsheetApp.getActiveSpreadsheet().getRangeByName('TaxRates'); if (range != null) { Logger.log(range.getNumColumns()); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | उस रेंज का नाम जिसे पाना है. |
वापसी का टिकट
Range — दिए गए नाम वाली सेल की रेंज.
getRangeList(a1Notations)
यह फ़ंक्शन, RangeList कलेक्शन दिखाता है. यह कलेक्शन, उसी शीट में मौजूद उन रेंज को दिखाता है जिन्हें A1 नोटेशन या R1C1 नोटेशन की ऐसी सूची से तय किया गया है जो खाली नहीं है.
// Get a list of ranges A1:D4, F1:H4. const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); const rangeList = sheet.getRangeList(['A1:D4', 'F1:H4']);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
a1Notations | String[] | A1 नोटेशन या R1C1 नोटेशन में बताई गई, वापस लानी है. |
वापसी का टिकट
RangeList — तय की गई जगह पर मौजूद रेंज की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRecalculationInterval()
यह फ़ंक्शन, इस स्प्रेडशीट के लिए कैलकुलेशन इंटरवल दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Logs the calculation interval for the spreadsheet to the console. console.log(ss.getRecalculationInterval().toString());
वापसी का टिकट
RecalculationInterval — इस स्प्रेडशीट के लिए, कैलकुलेशन का इंटरवल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRowHeight(rowPosition)
यह तरीका, दी गई लाइन की ऊंचाई को पिक्सल में दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Rows start at 1 Logger.log(sheet.getRowHeight(1));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | जांच की जाने वाली लाइन की पोज़िशन. |
वापसी का टिकट
Integer — पिक्सल में लाइन की ऊंचाई.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getSelection()
यह फ़ंक्शन, स्प्रेडशीट में मौजूद मौजूदा Selection दिखाता है.
const selection = SpreadsheetApp.getActiveSpreadsheet().getSelection(); const currentCell = selection.getCurrentCell();
वापसी का टिकट
Selection — फ़िलहाल चुना गया आइटम.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getSheetById(id)
इस फ़ंक्शन से, दिए गए आईडी वाली शीट मिलती है. Sheet.getSheetId() का उपयोग करें.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetById(12345);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
id | Integer | जिस शीट को पाना है उसका आईडी. |
वापसी का टिकट
Sheet|null — दिए गए आईडी वाली शीट या अगर कोई शीट नहीं मिलती है, तो null.
getSheetByName(name)
यह फ़ंक्शन, दिए गए नाम वाली शीट दिखाता है.
अगर कई शीट के नाम एक जैसे हैं, तो सबसे बाईं ओर वाली शीट का नाम दिखाया जाता है. अगर दिए गए नाम की कोई शीट मौजूद नहीं है, तो null दिखाता है.
// The code below logs the index of a sheet named "Expenses" const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Expenses'); if (sheet != null) { Logger.log(sheet.getIndex()); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | उस शीट का नाम जिसे पाना है. |
वापसी का टिकट
Sheet|null — दिए गए नाम वाली शीट या अगर कोई शीट नहीं मिलती है, तो null.
getSheetId()
यह फ़ंक्शन, इस ऑब्जेक्ट से दिखाई गई शीट का आईडी दिखाता है.
यह शीट का आईडी है, जो स्प्रेडशीट के लिए यूनीक होता है. यह आईडी, शीट बनाते समय असाइन किया गया पूर्णांक होता है. यह लगातार बढ़ता रहता है. साथ ही, यह शीट की पोज़िशन से अलग होता है. यह Range.copyFormatToRange(gridId, column, columnEnd, row, rowEnd) जैसे तरीकों के साथ काम करता है. ये तरीके, Sheet इंस्टेंस के बजाय gridId पैरामीटर लेते हैं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; Logger.log(sheet.getSheetId());
वापसी का टिकट
Integer — यह स्प्रेडशीट में मौजूद शीट का यूनीक आईडी होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getSheetName()
यह फ़ंक्शन, शीट का नाम दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; Logger.log(sheet.getSheetName());
वापसी का टिकट
String — शीट का नाम.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getSheetValues(startRow, startColumn, numRows, numColumns)
यह फ़ंक्शन, दिए गए कोऑर्डिनेट से शुरू होने वाली इस रेंज के लिए, वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है. पंक्ति या कॉलम की पोज़िशन के तौर पर दी गई -1 वैल्यू का मतलब है कि आपको शीट में मौजूद डेटा वाली आखिरी पंक्ति या कॉलम चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The two samples below produce the same output let values = sheet.getSheetValues(1, 1, 3, 3); Logger.log(values); const range = sheet.getRange(1, 1, 3, 3); values = range.getValues(); Logger.log(values);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
start | Integer | शुरू होने वाली लाइन की पोज़िशन. |
start | Integer | शुरुआती कॉलम की पोज़िशन. |
num | Integer | उन पंक्तियों की संख्या जिनके लिए वैल्यू दिखानी हैं. |
num | Integer | कितने कॉलम की वैल्यू दिखानी हैं. |
वापसी का टिकट
Object[][] — वैल्यू की दो डाइमेंशन वाली सरणी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getSheets()
यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद सभी शीट को दिखाता है.
// The code below logs the name of the second sheet const sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); // Iterates through the sheets and logs the name and ID of each sheet. for (const sheet of sheets) { Logger.log(`name: ${sheet.getName()}, ID: ${sheet.getSheetId()}`); }
वापसी का टिकट
Sheet[] — स्प्रेडशीट में मौजूद सभी शीट का कलेक्शन.
getSpreadsheetLocale()
यह स्प्रेडशीट का स्थान-भाषा कोड दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets the spreadsheet locale. const ssLocale = ss.getSpreadsheetLocale(); // Logs the locale to the console. console.log(ssLocale);
वापसी का टिकट
String — स्प्रेडशीट की स्थान-भाषा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getSpreadsheetTheme()
यह फ़ंक्शन, स्प्रेडशीट की मौजूदा थीम दिखाता है. अगर कोई थीम लागू नहीं की गई है, तो यह null दिखाता है.
// The code below returns the current theme of the spreadsheet. const currentTheme = SpreadsheetApp.getActiveSpreadsheet().getSpreadsheetTheme();
वापसी का टिकट
SpreadsheetTheme|null — यह मौजूदा थीम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getSpreadsheetTimeZone()
स्प्रेडशीट के टाइम ज़ोन की जानकारी मिलती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the time zone of the spreadsheet. ss.setSpreadsheetTimeZone('America/New_York'); // Gets the time zone of the spreadsheet. const ssTimeZone = ss.getSpreadsheetTimeZone(); // Logs the time zone to the console. console.log(ssTimeZone);
वापसी का टिकट
String — समय क्षेत्र, जिसे "long" फ़ॉर्मैट में तय किया गया है. उदाहरण के लिए, Joda.org की सूची के मुताबिक, "America/New_York".
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getUrl()
यह फ़ंक्शन, दी गई स्प्रेडशीट के लिए यूआरएल दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); Logger.log(ss.getUrl());
वापसी का टिकट
String — दी गई स्प्रेडशीट का यूआरएल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getViewers()
इस Spreadsheet के लिए, दर्शकों और टिप्पणी करने वालों की सूची मिलती है.
वापसी का टिकट
User[] — व्यू या टिप्पणी करने की अनुमति वाले उपयोगकर्ताओं की एक सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
hideColumn(column)
यह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को छिपाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This hides the first column let range = sheet.getRange('A1'); sheet.hideColumn(range); // This hides the first 3 columns range = sheet.getRange('A:C'); sheet.hideColumn(range);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Range | छिपाने के लिए कॉलम की रेंज. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
hideRow(row)
यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों को छिपाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This hides the first row const range = sheet.getRange('A1'); sheet.hideRow(range);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Range | छिपाने के लिए लाइन की रेंज. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertColumnAfter(afterPosition)
यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद एक कॉलम जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This inserts a column after the first column position sheet.insertColumnAfter(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
after | Integer | वह कॉलम जिसके बाद नया कॉलम जोड़ा जाना चाहिए. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertColumnBefore(beforePosition)
यह फ़ंक्शन, दी गई कॉलम पोज़िशन से पहले एक कॉलम जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This inserts a column in the first column position sheet.insertColumnBefore(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
before | Integer | वह कॉलम जिसके पहले नया कॉलम जोड़ा जाना चाहिए. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertColumnsAfter(afterPosition, howMany)
यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद, तय किए गए कॉलम की संख्या को जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Inserts two columns after the first column on the first sheet of the // spreadsheet. sheet.insertColumnsAfter(1, 2);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
after | Integer | वह कॉलम जिसके बाद नया कॉलम जोड़ा जाना चाहिए. |
how | Integer | कॉलम की संख्या. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertColumnsBefore(beforePosition, howMany)
यह फ़ंक्शन, कॉलम की दी गई पोज़िशन से पहले कई कॉलम जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This inserts five columns before the first column sheet.insertColumnsBefore(1, 5);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
before | Integer | वह कॉलम जिसके पहले नया कॉलम जोड़ा जाना चाहिए. |
how | Integer | जोड़े जाने वाले कॉलम की संख्या. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertDataSourceSheet(spec)
यह स्प्रेडशीट में एक नया DataSourceSheet जोड़ता है और डेटा को प्रोसेस करना शुरू करता है. इसका एक और असर यह होता है कि नई शीट, ऐक्टिव शीट बन जाती है.
अगर डेटा सोर्स टाइप चालू नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है. किसी खास तरह के डेटा सोर्स का डेटा प्रोसेस करने के लिए, SpreadsheetApp#enable...Execution() तरीकों का इस्तेमाल करें.
// Activates BigQuery operations. SpreadsheetApp.enableBigQueryExecution(); // Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Builds a data source specification. // TODO (developer): Update the project ID to your own Google Cloud project ID. const dataSourceSpec = SpreadsheetApp.newDataSourceSpec() .asBigQuery() .setProjectId('project-id-1') .setTableProjectId('bigquery-public-data') .setDatasetId('ncaa_basketball') .setTableId('mbb_historical_teams_games') .build(); // Adds the data source and its data to the spreadsheet. ss.insertDataSourceSheet(dataSourceSpec);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
spec | Data | डेटा सोर्स स्पेसिफ़िकेशन, जिसे शामिल करना है. |
वापसी का टिकट
DataSourceSheet — नई डेटा सोर्स शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertImage(blobSource, column, row)
यह फ़ंक्शन, किसी दस्तावेज़ में दी गई पंक्ति और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है. इमेज का साइज़, blob के कॉन्टेंट से लिया जाता है. BLOB का साइज़ ज़्यादा से ज़्यादा 2 एमबी हो सकता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const binaryData = []; // TODO(developer): Replace with your binary data. const blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName'); sheet.insertImage(blob, 1, 1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
blob | Blob | इमेज के कॉन्टेंट, MIME टाइप, और (ज़रूरी नहीं) नाम वाला ब्लॉब. |
column | Integer | कॉलम की पोज़िशन. |
row | Integer | लाइन की पोज़िशन. |
वापसी का टिकट
OverGridImage — यह शामिल की गई इमेज है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertImage(blobSource, column, row, offsetX, offsetY)
यह फ़ंक्शन, किसी दस्तावेज़ में दी गई लाइन और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है. साथ ही, इसमें पिक्सल ऑफ़सेट भी शामिल होता है. इमेज का साइज़, blob के कॉन्टेंट से लिया जाता है. BLOB का साइज़ ज़्यादा से ज़्यादा 2 एमबी हो सकता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const binaryData = []; // TODO(developer): Replace with your binary data. const blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName'); sheet.insertImage(blob, 1, 1, 10, 10);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
blob | Blob | इमेज के कॉन्टेंट, MIME टाइप, और (ज़रूरी नहीं) नाम वाला ब्लॉब. |
column | Integer | कॉलम की पोज़िशन. |
row | Integer | लाइन की पोज़िशन. |
offsetX | Integer | सेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट, पिक्सल में. |
offsetY | Integer | सेल के कोने से वर्टिकल ऑफ़सेट, पिक्सल में. |
वापसी का टिकट
OverGridImage — यह शामिल की गई इमेज है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertImage(url, column, row)
दस्तावेज़ में किसी दी गई पंक्ति और कॉलम में इमेज डालता है.
सबमिट किया गया यूआरएल ऐसा होना चाहिए जिसे कोई भी ऐक्सेस कर सके.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.insertImage('https://www.google.com/images/srpr/logo3w.png', 1, 1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
url | String | इमेज का यूआरएल. |
column | Integer | ग्रिड कॉलम की पोज़िशन. |
row | Integer | ग्रिड की लाइन की पोज़िशन. |
वापसी का टिकट
OverGridImage — यह शामिल की गई इमेज है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertImage(url, column, row, offsetX, offsetY)
यह फ़ंक्शन, दस्तावेज़ में किसी इमेज को तय की गई लाइन और कॉलम में पिक्सल ऑफ़सेट के साथ जोड़ता है.
सबमिट किया गया यूआरएल ऐसा होना चाहिए जिसे कोई भी ऐक्सेस कर सके.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.insertImage( 'https://www.google.com/images/srpr/logo3w.png', 1, 1, 10, 10, );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
url | String | इमेज का यूआरएल. |
column | Integer | कॉलम की पोज़िशन. |
row | Integer | लाइन की पोज़िशन. |
offsetX | Integer | सेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट, पिक्सल में. |
offsetY | Integer | सेल के कोने से वर्टिकल ऑफ़सेट, पिक्सल में. |
वापसी का टिकट
OverGridImage — यह शामिल की गई इमेज है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertRowAfter(afterPosition)
यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद एक पंक्ति जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This inserts a row after the first row position sheet.insertRowAfter(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
after | Integer | वह लाइन जिसके बाद नई लाइन जोड़ी जानी चाहिए. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertRowBefore(beforePosition)
यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले एक पंक्ति जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This inserts a row before the first row position sheet.insertRowBefore(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
before | Integer | वह लाइन जिसके पहले नई लाइन जोड़ी जानी चाहिए. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertRowsAfter(afterPosition, howMany)
यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद कई पंक्तियां जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This inserts five rows after the first row sheet.insertRowsAfter(1, 5);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
after | Integer | वह पंक्ति जिसके बाद नई पंक्तियां जोड़ी जानी चाहिए. |
how | Integer | डालने के लिए पंक्तियों की संख्या. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertRowsBefore(beforePosition, howMany)
यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले कई पंक्तियां जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This inserts five rows before the first row sheet.insertRowsBefore(1, 5);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
before | Integer | वह लाइन जिसके पहले नई लाइनें जोड़ी जानी चाहिए. |
how | Integer | डालने के लिए पंक्तियों की संख्या. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet()
यह फ़ंक्शन, स्प्रेडशीट में डिफ़ॉल्ट शीट के नाम का इस्तेमाल करके नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.insertSheet();
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet(sheetIndex)
यह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर एक नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.insertSheet(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | Integer | नई बनाई गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर शामिल करने के लिए, उसे 0 पर सेट करें. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet(sheetIndex, options)
यह फ़ंक्शन, दी गई इंडेक्स वैल्यू के हिसाब से स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, इसमें वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const templateSheet = ss.getSheetByName('Sales'); ss.insertSheet(1, {template: templateSheet});
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | Integer | नई बनाई गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर शामिल करने के लिए, उसे 0 पर सेट करें. |
options | Object | JavaScript के बेहतर आर्ग्युमेंट (ज़रूरी नहीं). |
उन्नत पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
template | Sheet | टेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी किया जाता है. शीट टेंप्लेट, Spreadsheet ऑब्जेक्ट की किसी एक शीट में होना चाहिए. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet(options)
यह फ़ंक्शन, स्प्रेडशीट में नई शीट जोड़ता है. इसके लिए, शीट के डिफ़ॉल्ट नाम और वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जाता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const templateSheet = ss.getSheetByName('Sales'); ss.insertSheet({template: templateSheet});
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
options | Object | JavaScript के बेहतर विकल्प वाले वैकल्पिक तर्क. इनकी सूची यहां दी गई है. |
उन्नत पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
template | Sheet | टेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी किया जाता है. शीट टेंप्लेट, इस स्प्रेडशीट ऑब्जेक्ट की किसी एक शीट का होना चाहिए. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet(sheetName)
यह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.insertSheet('My New Sheet');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | String | नई शीट का नाम. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet(sheetName, sheetIndex)
यह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर, दिए गए नाम की नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.insertSheet('My New Sheet', 1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | String | नई शीट का नाम. |
sheet | Integer | नई बनाई गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर शामिल करने के लिए, उसे 0 पर सेट करें. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet(sheetName, sheetIndex, options)
यह फ़ंक्शन, स्प्रैडशीट में दी गई इंडेक्स वैल्यू पर दिए गए नाम की नई शीट जोड़ता है. साथ ही, यह ज़रूरत के हिसाब से ऐडवांस आर्ग्युमेंट का इस्तेमाल करता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const templateSheet = ss.getSheetByName('Sales'); ss.insertSheet('My New Sheet', 1, {template: templateSheet});
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | String | नई शीट का नाम. |
sheet | Integer | नई जोड़ी गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर शामिल करने के लिए, उसे 0 पर सेट करें. |
options | Object | JavaScript के बेहतर आर्ग्युमेंट (ज़रूरी नहीं). |
उन्नत पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
template | Sheet | टेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी किया जाता है. शीट टेंप्लेट, Spreadsheet ऑब्जेक्ट की किसी एक शीट में होना चाहिए. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheet(sheetName, options)
यह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है. साथ ही, इसमें ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है. नई शीट, ऐक्टिव शीट बन जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const templateSheet = ss.getSheetByName('Sales'); ss.insertSheet('My New Sheet', {template: templateSheet});
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | String | नई शीट का नाम. |
options | Object | JavaScript के बेहतर आर्ग्युमेंट (ज़रूरी नहीं). |
उन्नत पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
template | Sheet | टेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी किया जाता है. शीट टेंप्लेट, Spreadsheet ऑब्जेक्ट की किसी एक शीट में होना चाहिए. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSheetWithDataSourceTable(spec)
यह स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, दिए गए डेटा सोर्स स्पेसिफ़िकेशन के साथ पूरी शीट में फ़ैला हुआ DataSourceTable बनाता है और डेटा को प्रोसेस करना शुरू करता है. इसका एक साइड इफ़ेक्ट यह है कि नई शीट, ऐक्टिव शीट बन जाती है.
अगर डेटा सोर्स टाइप चालू नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है. किसी खास तरह के डेटा सोर्स का डेटा प्रोसेस करने के लिए, SpreadsheetApp#enable...Execution() तरीकों का इस्तेमाल करें.
// Activates BigQuery operations. SpreadsheetApp.enableBigQueryExecution(); // Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Adds a sheet and sets cell A1 as the parameter cell. const parameterCell = ss.insertSheet('parameterSheet').getRange('A1'); // Sets the value of the parameter cell to 'Duke'. parameterCell.setValue('Duke'); const query = 'select * from `bigquery-public-data`.`ncaa_basketball`.' + '`mbb_historical_tournament_games` WHERE win_school_ncaa = @SCHOOL'; // Adds a data source with a query parameter. // TODO(developer): Update the project ID to your own Google Cloud project ID. const dataSourceSpec = SpreadsheetApp.newDataSourceSpec() .asBigQuery() .setProjectId('project-id-1') .setRawQuery(query) .setParameterFromCell('SCHOOL', 'parameterSheet!A1') .build(); // Adds sheets for the data source and data source table to the spreadsheet. ss.insertSheetWithDataSourceTable(dataSourceSpec);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
spec | Data | डेटा सोर्स स्पेसिफ़िकेशन, जिसे शामिल करना है. |
वापसी का टिकट
Sheet — नई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isColumnHiddenByUser(columnPosition)
यह फ़ंक्शन बताता है कि उपयोगकर्ता ने दी गई कॉलम को छिपाया है या नहीं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Columns start at 1 Logger.log(sheet.isColumnHiddenByUser(1));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | जांच किए जाने वाले कॉलम की पोज़िशन. |
वापसी का टिकट
Boolean — अगर कॉलम छिपा हुआ है, तो true. अगर कॉलम छिपा हुआ नहीं है, तो false.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isIterativeCalculationEnabled()
यह फ़ंक्शन बताता है कि इस स्प्रेडशीट में इटरेटिव कैलकुलेशन चालू है या नहीं.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Activates iterative calculation on the spreadsheet. ss.setIterativeCalculationEnabled(true); // Logs whether iterative calculation is activated for the spreadsheet. console.log(ss.isIterativeCalculationEnabled());
वापसी का टिकट
Boolean — true अगर इटरेटिव कैलकुलेशन चालू है, तो false नहीं तो.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isRowHiddenByFilter(rowPosition)
यह फ़ंक्शन बताता है कि दी गई लाइन को फ़िल्टर (फ़िल्टर व्यू नहीं) की मदद से छिपाया गया है या नहीं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Rows start at 1 Logger.log(sheet.isRowHiddenByFilter(1));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | जांच की जाने वाली लाइन की पोज़िशन. |
वापसी का टिकट
Boolean — अगर लाइन छिपी हुई है, तो true. अगर लाइन नहीं छिपी हुई है, तो false.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isRowHiddenByUser(rowPosition)
इससे यह पता चलता है कि दी गई लाइन को उपयोगकर्ता ने छिपाया है या नहीं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Rows start at 1 Logger.log(sheet.isRowHiddenByUser(1));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | जांच की जाने वाली लाइन की पोज़िशन. |
वापसी का टिकट
Boolean — अगर लाइन छिपी हुई है, तो true. अगर लाइन नहीं छिपी हुई है, तो false.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
moveActiveSheet(pos)
इस फ़ंक्शन की मदद से, चालू शीट को शीट की सूची में दी गई जगह पर ले जाया जाता है. अगर पोज़िशन नेगेटिव है या शीट की संख्या से ज़्यादा है, तो यह फ़ंक्शन एक अपवाद दिखाता है.
// This example assumes that there are 2 sheets in the current // active spreadsheet: one named "first" in position 1 and another named // "second" in position 2. const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // Gets the "first" sheet and activates it. const sheet = spreadsheet.getSheetByName('first').activate(); // Logs 'Current index of sheet: 1' console.log('Current index of sheet: %s', sheet.getIndex()); spreadsheet.moveActiveSheet(2); // Logs 'New index of sheet: 2' console.log('New index of sheet: %s', sheet.getIndex());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
pos | Integer | शीट की सूची में, ऐक्टिव शीट को जिस जगह पर ले जाना है उसकी 1-इंडेक्स वाली पोज़िशन. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
moveChartToObjectSheet(chart)
यह फ़ंक्शन, नई SheetType.OBJECT शीट बनाता है और दिए गए चार्ट को उसमें ले जाता है. अगर चार्ट पहले से ही किसी शीट पर मौजूद है, तो नई शीट बनाए बिना ही उस शीट को वापस भेज दिया जाता है.
const sheet = SpreadsheetApp.getActiveSheet(); const chart = sheet.newChart().setPosition(1, 1, 0, 0).build(); sheet.insertChart(chart); const objectSheet = SpreadsheetApp.getActive().moveChartToObjectSheet(chart);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
chart | Embedded | वह चार्ट जिसे ले जाना है. |
वापसी का टिकट
Sheet — वह शीट जिस पर चार्ट मौजूद है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
refreshAllDataSources()
यह सुविधा, काम करने वाले सभी डेटा सोर्स और उनसे लिंक किए गए डेटा सोर्स ऑब्जेक्ट को रीफ़्रेश करती है. साथ ही, अमान्य डेटा सोर्स ऑब्जेक्ट को छोड़ देती है.
किसी खास डेटा सोर्स टाइप के लिए डेटा प्रोसेस करने की सुविधा चालू करने के लिए, SpreadsheetApp#enable...Execution() तरीकों का इस्तेमाल करें.
// Activates BigQuery operations. SpreadsheetApp.enableBigQueryExecution(); // Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets the first data source sheet on the spreadsheet. const dataSheet = ss.getDataSourceSheets()[0]; // Refreshes all data sources on the spreadsheet. ss.refreshAllDataSources(); // Logs the last refreshed time of the first data source sheet. console.log( `Last refresh time: ${dataSheet.getStatus().getLastRefreshedTime()}`, );
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeEditor(emailAddress)
इस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के एडिटर की सूची से हटा दिया जाता है. अगर उपयोगकर्ता ऐसे लोगों की कैटगरी में आता है जिनके पास सामान्य ऐक्सेस है, तो इस तरीके से उन्हें Spreadsheet ऐक्सेस करने से नहीं रोका जा सकता. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.
Drive में मौजूद फ़ाइलों के लिए, इससे उपयोगकर्ता को व्यूअर की सूची से भी हटा दिया जाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | उस उपयोगकर्ता का ईमेल पता जिसे हटाना है. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeEditor(user)
इस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के एडिटर की सूची से हटा दिया जाता है. अगर उपयोगकर्ता ऐसे लोगों की कैटगरी में आता है जिनके पास सामान्य ऐक्सेस है, तो इस तरीके से उन्हें Spreadsheet ऐक्सेस करने से नहीं रोका जा सकता. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.
Drive में मौजूद फ़ाइलों के लिए, इससे उपयोगकर्ता को व्यूअर की सूची से भी हटा दिया जाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | उस उपयोगकर्ता का प्रतिनिधित्व जिसे हटाना है. |
वापसी का टिकट
Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeMenu(name)
addMenu(name, subMenus) से जोड़े गए मेन्यू को हटाता है. name आर्ग्युमेंट की वैल्यू, addMenu(name, subMenus) को किए गए कॉल की वैल्यू के बराबर होनी चाहिए.
// The onOpen function is executed automatically every time a Spreadsheet is // loaded function onOpen() { const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.addMenu('badMenu', [ {name: 'remove bad menu', functionName: 'removeBadMenu'}, {name: 'foo', functionName: 'foo'}, ]); } function removeBadMenu() { const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.removeMenu( 'badMenu'); // name must match the name used when added the menu } function foo() { // Do nothing }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | हटाए जाने वाले मेन्यू का नाम. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeNamedRange(name)
इस फ़ंक्शन का इस्तेमाल करके, दिए गए नाम वाली रेंज को मिटाया जा सकता है. अगर स्प्रेडशीट में दिए गए नाम वाली कोई रेंज नहीं मिलती है, तो यह फ़ंक्शन एक अपवाद दिखाता है.
// The code below creates a new named range "foo", and then remove it. const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.setNamedRange('foo', ss.getActiveRange()); ss.removeNamedRange('foo');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | रेंज का नाम. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeViewer(emailAddress)
इस फ़ंक्शन का इस्तेमाल करके, किसी उपयोगकर्ता को Spreadsheet के दर्शकों और टिप्पणीकारों की सूची से हटाया जा सकता है. अगर उपयोगकर्ता व्यूअर या टिप्पणीकार नहीं, बल्कि एडिटर है, तो इस तरीके का कोई असर नहीं पड़ता. इस तरीके से, उन उपयोगकर्ताओं को Spreadsheet ऐक्सेस करने से भी नहीं रोका जाता है जिनके पास सामान्य ऐक्सेस होता है. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet किसी ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.
Drive की फ़ाइलों के लिए, इससे उपयोगकर्ता को संपादकों की सूची से भी हटा दिया जाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
email | String | उस उपयोगकर्ता का ईमेल पता जिसे हटाना है. |
वापसी का टिकट
Spreadsheet — This Spreadsheet for chaining.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeViewer(user)
इस फ़ंक्शन का इस्तेमाल करके, किसी उपयोगकर्ता को Spreadsheet के दर्शकों और टिप्पणीकारों की सूची से हटाया जा सकता है. अगर उपयोगकर्ता व्यूअर के बजाय एडिटर है, तो इस तरीके का कोई असर नहीं पड़ता. इस तरीके से, उन उपयोगकर्ताओं को Spreadsheet ऐक्सेस करने से भी नहीं रोका जा सकता जो उपयोगकर्ताओं की ऐसी क्लास से जुड़े हैं जिनके पास सामान्य ऐक्सेस है. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet किसी ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.
Drive की फ़ाइलों के लिए, इससे उपयोगकर्ता को संपादकों की सूची से भी हटा दिया जाता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | User | उस उपयोगकर्ता का प्रतिनिधित्व जिसे हटाना है. |
वापसी का टिकट
Spreadsheet — This Spreadsheet for chaining.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
rename(newName)
दस्तावेज़ का नाम बदलता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.rename('This is the new name');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
new | String | दस्तावेज़ का नया नाम. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
renameActiveSheet(newName)
इस फ़ंक्शन की मदद से, मौजूदा चालू शीट का नाम बदलकर नया नाम रखा जा सकता है.
// The code below renames the active sheet to "Hello world" SpreadsheetApp.getActiveSpreadsheet().renameActiveSheet('Hello world');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
new | String | मौजूदा ऐक्टिव शीट का नया नाम. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
resetSpreadsheetTheme()
यह फ़ंक्शन, स्प्रेडशीट पर लागू की गई थीम को हटाता है और डिफ़ॉल्ट थीम सेट करता है.
// The code below applies default theme on the spreadsheet. SpreadsheetApp.getActiveSpreadsheet().resetSpreadsheetTheme();
वापसी का टिकट
SpreadsheetTheme — डिफ़ॉल्ट थीम.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setActiveRange(range)
यह फ़ंक्शन, चुनी गई रेंज को चालू शीट में active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर मौजूद बाएं सेल को current cell के तौर पर सेट करता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); const range = sheet.getRange('A1:D4'); sheet.setActiveRange(range); const selection = sheet.getSelection(); // Current cell: A1 const currentCell = selection.getCurrentCell(); // Active Range: A1:D4 const activeRange = selection.getActiveRange();
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
range | Range | ऐक्टिव रेंज के तौर पर सेट की जाने वाली रेंज. |
वापसी का टिकट
Range — नई रेंज चालू की गई है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setActiveRangeList(rangeList)
यह फ़ंक्शन, रेंज की दी गई सूची को ऐक्टिव शीट में active ranges के तौर पर सेट करता है. सूची में मौजूद आखिरी रेंज को active range के तौर पर सेट किया जाता है.
const sheet = SpreadsheetApp.getActiveSheet(); const rangeList = sheet.getRangeList(['D4', 'B2:C4']); sheet.setActiveRangeList(rangeList); const selection = sheet.getSelection(); // Current cell: B2 const currentCell = selection.getCurrentCell(); // Active range: B2:C4 const activeRange = selection.getActiveRange(); // Active range list: [D4, B2:C4] const activeRangeList = selection.getActiveRangeList();
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
range | Range | चुनी जाने वाली रेंज की सूची. |
वापसी का टिकट
RangeList — रेंज की नई चुनी गई सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setActiveSelection(range)
इस शीट के लिए, चुने गए सेल की रेंज सेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:D4'); sheet.setActiveSelection(range);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
range | Range | ऐक्टिव सिलेक्शन के तौर पर सेट की जाने वाली रेंज. |
वापसी का टिकट
Range — नई रेंज चालू की गई है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setActiveSelection(a1Notation)
यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताए गए तरीके से, ऐक्टिव सेल को चुनता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.setActiveSelection('A1:D4');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
a1Notation | String | A1 नोटेशन या R1C1 नोटेशन में बताई गई वह रेंज जिसे चालू के तौर पर सेट करना है. |
वापसी का टिकट
Range — नई रेंज चालू की गई है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setActiveSheet(sheet)
यह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है. Google Sheets के यूज़र इंटरफ़ेस (यूआई) में, चुनी गई शीट दिखती है. हालांकि, ऐसा तब होता है, जब शीट किसी दूसरी स्प्रेडशीट से जुड़ी न हो.
// The code below makes the first sheet active in the active spreadsheet. const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); spreadsheet.setActiveSheet(spreadsheet.getSheets()[0]);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | Sheet | ऐक्टिव शीट के तौर पर सेट की जाने वाली शीट. |
वापसी का टिकट
Sheet — यह ऐक्टिव शीट है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setActiveSheet(sheet, restoreSelection)
यह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है. साथ ही, उस शीट में सबसे हाल ही में किए गए चुनाव को वापस लाने का विकल्प देता है. Google Sheets का यूज़र इंटरफ़ेस (यूआई), चुनी गई शीट को तब तक दिखाता है, जब तक वह शीट किसी दूसरी स्प्रेडशीट से जुड़ी न हो.
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); const firstSheet = spreadsheet.getSheets()[0]; const secondSheet = spreadsheet.getSheets()[1]; // Set the first sheet as the active sheet and select the range D4:F4. spreadsheet.setActiveSheet(firstSheet).getRange('D4:F4').activate(); // Switch to the second sheet to do some work. spreadsheet.setActiveSheet(secondSheet); // Switch back to first sheet, and restore its selection. spreadsheet.setActiveSheet(firstSheet, true); // The selection of first sheet is restored, and it logs D4:F4 const range = spreadsheet.getActiveSheet().getSelection().getActiveRange(); Logger.log(range.getA1Notation());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | Sheet | नई ऐक्टिव शीट. |
restore | Boolean | true होने पर, नई ऐक्टिव शीट का सबसे हाल का चुना गया सेल फिर से चुना जाता है, क्योंकि नई शीट ऐक्टिव हो जाती है. वहीं, false होने पर, मौजूदा सेल को बदले बिना नई शीट ऐक्टिव हो जाती है. |
वापसी का टिकट
Sheet — नई ऐक्टिव शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setColumnWidth(columnPosition, width)
इससे, दिए गए कॉलम की चौड़ाई पिक्सल में सेट होती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sets the first column to a width of 200 pixels sheet.setColumnWidth(1, 200);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | सेट करने के लिए, दिए गए कॉलम की पोज़िशन. |
width | Integer | चौड़ाई को पिक्सल में सेट करने के लिए. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setCurrentCell(cell)
यह फ़ंक्शन, तय की गई सेल को current cell के तौर पर सेट करता है.
अगर तय की गई सेल, पहले से चुनी गई किसी रेंज में मौजूद है, तो वह रेंज, मौजूदा सेल के साथ ऐक्टिव रेंज बन जाती है.
अगर बताई गई सेल, चुनी गई किसी भी रेंज में मौजूद नहीं है, तो मौजूदा सिलेक्शन हटा दिया जाता है. साथ ही, सेल को मौजूदा सेल और ऐक्टिव रेंज बना दिया जाता है.
ध्यान दें:बताई गई Range में सिर्फ़ एक सेल होनी चाहिए. ऐसा न होने पर, यह फ़ंक्शन एक अपवाद दिखाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); const cell = sheet.getRange('B5'); sheet.setCurrentCell(cell); const selection = sheet.getSelection(); // Current cell: B5 const currentCell = selection.getCurrentCell();
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
cell | Range | वह सेल जिसे मौजूदा सेल के तौर पर सेट करना है. |
वापसी का टिकट
Range — नई सेट की गई मौजूदा सेल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFrozenColumns(columns)
इससे, दी गई संख्या के हिसाब से कॉलम फ़्रीज़ हो जाते हैं. अगर वैल्यू शून्य है, तो कोई भी कॉलम फ़्रीज़ नहीं किया जाता.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Freezes the first column sheet.setFrozenColumns(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
columns | Integer | फ़्रीज़ किए जाने वाले कॉलम की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFrozenRows(rows)
दी गई पंक्तियों की संख्या को फ़्रीज़ करता है. अगर वैल्यू शून्य है, तो कोई भी लाइन फ़्रीज़ नहीं की जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Freezes the first row sheet.setFrozenRows(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
rows | Integer | फ़्रीज़ की जाने वाली पंक्तियों की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setIterativeCalculationConvergenceThreshold(minThreshold)
यह विकल्प, बार-बार होने वाली कैलकुलेशन के लिए कम से कम थ्रेशोल्ड वैल्यू सेट करता है. जब लगातार की गई कैलकुलेशन के नतीजे इस वैल्यू से कम होते हैं, तो बार-बार की जाने वाली कैलकुलेशन बंद हो जाती है. यह वैल्यू, शून्य या इससे ज़्यादा होनी चाहिए. डिफ़ॉल्ट रूप से, यह 0.05 होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the iterative calculation convergence threshold for the spreadsheet. ss.setIterativeCalculationConvergenceThreshold(2); // Logs the threshold to the console. console.log(ss.getIterativeCalculationConvergenceThreshold());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
min | Number | कम से कम कन्वर्जेंस थ्रेशोल्ड (शून्य से ज़्यादा होना चाहिए). |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setIterativeCalculationEnabled(isEnabled)
इस स्प्रेडशीट में इटरेटिव कैलकुलेशन की सुविधा चालू है या नहीं, यह सेट करता है. अगर कैलकुलेशन चालू करते समय, कैलकुलेशन साइकल की ज़्यादा से ज़्यादा संख्या और कन्वर्जेंस थ्रेशोल्ड पहले से सेट नहीं किया गया है, तो ये डिफ़ॉल्ट रूप से 50 और 0.05 पर सेट हो जाते हैं. अगर इनमें से कोई भी वैल्यू पहले से सेट है, तो वे अपनी पिछली वैल्यू बनाए रखती हैं.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Activates iterative calculation on the spreadsheet. ss.setIterativeCalculationEnabled(true); // Logs whether iterative calculation is activated for the spreadsheet. console.log(ss.isIterativeCalculationEnabled());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
is | Boolean | true अगर इटरेटिव कैलकुलेशन चालू करनी है; false
अन्यथा. |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setMaxIterativeCalculationCycles(maxIterations)
इससे कैलकुलेशन के दोहराव की ज़्यादा से ज़्यादा संख्या सेट की जाती है. यह संख्या, कैलकुलेशन के दोहराव के दौरान इस्तेमाल की जाती है. यह वैल्यू, 1 से 10,000 के बीच होनी चाहिए. हालांकि, इन दोनों में से भी कोई संख्या हो सकती है. इसकी डिफ़ॉल्ट वैल्यू 50 होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the max iterative calculation cycles for the spreadsheet. ss.setMaxIterativeCalculationCycles(10); // Logs the max iterative calculation cycles to the console. console.log(ss.getMaxIterativeCalculationCycles());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
max | Integer | कैलकुलेशन के लिए ज़्यादा से ज़्यादा पुनरावृत्तियां (1 से 10,000 के बीच). |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setNamedRange(name, range)
किसी रेंज को नाम देता है.
// The code below creates a new named range "TaxRates" in the active spreadsheet const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.setNamedRange('TaxRates', SpreadsheetApp.getActiveRange());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | रेंज को दिया जाने वाला नाम. |
range | Range | रेंज की खास जानकारी. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRecalculationInterval(recalculationInterval)
इससे यह तय होता है कि इस स्प्रेडशीट को कितनी बार फिर से कैलकुलेट करना चाहिए.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the calculation interval for the spreadsheet to 'ON_CHANGE'. const interval = ss.setRecalculationInterval( SpreadsheetApp.RecalculationInterval.ON_CHANGE, ); // Logs the calculation interval to the console. console.log(interval);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
recalculation | Recalculation | दोबारा हिसाब लगाने का नया इंटरवल. |
वापसी का टिकट
Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRowHeight(rowPosition, height)
यह विकल्प, दी गई लाइन की ऊंचाई को पिक्सल में सेट करता है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियों की ऊंचाई बढ़ जाती है. अगर आपको पंक्तियों को किसी तय ऊंचाई पर सेट करना है, तो Sheet.setRowHeightsForced(startRow, numRows, height) का इस्तेमाल करें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sets the first row to a height of 200 pixels sheet.setRowHeight(1, 200);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | बदलाव करने के लिए लाइन की पोज़िशन. |
height | Integer | इसे सेट करने के लिए पिक्सल में ऊंचाई. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setSpreadsheetLocale(locale)
स्प्रेडशीट की भाषा सेट करता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the spreadsheet locale. ss.setSpreadsheetLocale('fr'); // Gets the spreadsheet locale. const ssLocale = ss.getSpreadsheetLocale(); // Logs the locale to the console. console.log(ssLocale);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
locale | String | इस्तेमाल किया जाने वाला स्थान-भाषा कोड (उदाहरण के लिए, 'en', 'fr' या 'en_US'). |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setSpreadsheetTheme(theme)
इस फ़ंक्शन का इस्तेमाल करके, स्प्रेडशीट में थीम सेट की जाती है.
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // The code below sets the second predefined theme as the current theme of the // spreadsheet. const predefinedThemesList = spreadsheet.getPredefinedSpreadsheetThemes(); spreadsheet.setSpreadsheetTheme(predefinedThemesList[1]);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
theme | Spreadsheet | लागू की जाने वाली थीम. |
वापसी का टिकट
SpreadsheetTheme — नई मौजूदा थीम.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setSpreadsheetTimeZone(timezone)
यह विकल्प, स्प्रेडशीट के लिए टाइम ज़ोन सेट करता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Sets the time zone of the spreadsheet. ss.setSpreadsheetTimeZone('America/New_York'); // Gets the time zone of the spreadsheet. const ssTimeZone = ss.getSpreadsheetTimeZone(); // Logs the time zone to the console. console.log(ssTimeZone);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
timezone | String | समय क्षेत्र, जिसे "long" फ़ॉर्मैट में तय किया गया है. उदाहरण के लिए, Joda.org में दिए गए "America/New_York". |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
show(userInterface)
यह फ़ंक्शन, उपयोगकर्ता के ब्राउज़र के व्यूपोर्ट के बीच में मौजूद डायलॉग में, कस्टम यूज़र इंटरफ़ेस कॉम्पोनेंट दिखाता है. सर्वर-साइड स्क्रिप्ट का एक्ज़ीक्यूशन निलंबित नहीं किया गया है. सर्वर साइड से कम्यूनिकेट करने के लिए, यूज़र इंटरफ़ेस कॉम्पोनेंट को सर्वर-साइड स्क्रिप्ट पर एसिंक्रोनस कॉलबैक करने होंगे.
अगर सर्वर-साइड स्क्रिप्ट ने पहले कोई ऐसा डायलॉग दिखाया था जिसे अब तक खारिज नहीं किया गया है, तो मौजूदा डायलॉग को, नए डायलॉग के यूज़र इंटरफ़ेस (यूआई) से बदल दिया जाता है.
नीचे दिया गया कोड स्निपेट, एक डायलॉग में सामान्य HtmlService ऐप्लिकेशन दिखाता है. इसमें टाइटल, ऊंचाई, और चौड़ाई तय की गई है:
const htmlApp = HtmlService .createHtmlOutput( '<p>A change of speed, a change of style...</p>', ) .setTitle('My HtmlService Application') .setWidth(250) .setHeight(300); SpreadsheetApp.getActiveSpreadsheet().show(htmlApp); // The script resumes execution immediately after showing the dialog.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
user | Object | Html. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/script.container.ui
sort(columnPosition)
यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से बढ़ते क्रम में लगाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sorts the sheet by the first column, ascending sheet.sort(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | जिस कॉलम के हिसाब से क्रम से लगाना है. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
sort(columnPosition, ascending)
यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से क्रम में लगाता है. यह पैरामीटर लेता है, ताकि बढ़ते या घटते क्रम के बारे में बताया जा सके.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sorts the sheet by the first column, descending sheet.sort(1, false);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | जिस कॉलम के हिसाब से क्रम से लगाना है. |
ascending | Boolean | बढ़ते क्रम के लिए true और घटते क्रम के लिए false. |
वापसी का टिकट
Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
toast(msg)
यह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में, दिए गए मैसेज के साथ एक पॉप-अप विंडो दिखाता है.
// Show a popup with the message "Task started". SpreadsheetApp.getActiveSpreadsheet().toast('Task started');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
msg | String | यह मैसेज, सूचना के तौर पर दिखाया जाएगा. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
toast(msg, title)
यह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में एक पॉप-अप विंडो दिखाता है. इसमें दिया गया मैसेज और टाइटल दिखता है.
// Show a popup with the title "Status" and the message "Task started". SpreadsheetApp.getActiveSpreadsheet().toast('Task started', 'Status');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
msg | String | यह मैसेज, सूचना के तौर पर दिखाया जाएगा. |
title | String | यह सूचना का वैकल्पिक टाइटल है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
toast(msg, title, timeoutSeconds)
यह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में एक पॉप-अप विंडो दिखाता है. इसमें दिया गया टाइटल और मैसेज होता है. यह विंडो कुछ समय तक दिखती है.
// Show a 3-second popup with the title "Status" and the message "Task started". SpreadsheetApp.getActiveSpreadsheet().toast('Task started', 'Status', 3);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
msg | String | यह मैसेज, सूचना के तौर पर दिखाया जाएगा. |
title | String | यह सूचना का वैकल्पिक टाइटल है. |
timeout | Number | टाइम आउट की अवधि सेकंड में; अगर null है, तो सूचना 5 सेकंड तक दिखती है;
अगर वैल्यू नेगेटिव है, तो सूचना तब तक दिखती है, जब तक उसे खारिज नहीं किया जाता. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
unhideColumn(column)
यह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This unhides the first column if it was previously hidden const range = sheet.getRange('A1'); sheet.unhideColumn(range);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Range | अगर कोई रेंज छिपी हुई है, तो उसे दिखाने के लिए यह विकल्प चुनें. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
unhideRow(row)
यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्ति को दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This unhides the first row if it was previously hidden const range = sheet.getRange('A1'); sheet.unhideRow(range);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Range | अगर कोई रेंज छिपी हुई है, तो उसे दिखाने के लिए यह विकल्प चुनें. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
updateMenu(name, subMenus)
addMenu(name, subMenus) से जोड़े गए मेन्यू को अपडेट करता है. यह addMenu(name, subMenus) की तरह ही काम करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const menuEntries = []; menuEntries.push({name: 'Lone Menu Entry', functionName: 'function1'}); ss.updateMenu('addMenuExample', menuEntries);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | अपडेट किए जाने वाले मेन्यू का नाम. |
sub | Object[] | name और function पैरामीटर वाले JavaScript मैप का कलेक्शन. इसमें शामिल लाइब्रेरी के फ़ंक्शन इस्तेमाल किए जा सकते हैं. जैसे,
Library.libFunction1. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
waitForAllDataExecutionsCompletion(timeoutInSeconds)
यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी मौजूदा एक्ज़ीक्यूशन के पूरा होने तक इंतज़ार करता है. साथ ही, तय किए गए सेकंड के बाद टाइम आउट हो जाता है. अगर टाइम आउट होने पर भी एक्ज़ीक्यूशन पूरे नहीं होते हैं, तो यह फ़ंक्शन एक अपवाद दिखाता है. हालांकि, यह डेटा एक्ज़ीक्यूशन को रद्द नहीं करता है.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
timeout | Integer | डेटा प्रोसेस होने के लिए तय किया गया समय, सेकंड में. ज़्यादा से ज़्यादा 300 सेकंड. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets