स्प्रेडशीट की शीट को ऐक्सेस और उनमें बदलाव कर सकता है. आम तौर पर, शीट का नाम बदलना और शीट से रेंज ऑब्जेक्ट ऐक्सेस करना जैसी कार्रवाइयां की जाती हैं.
तरीके
| तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
|---|---|---|
activate() | Sheet | इस शीट को चालू करता है. |
add | Sheet | यह फ़ंक्शन, शीट में दी गई कुंजी के साथ डेवलपर मेटाडेटा जोड़ता है. |
add | Sheet | यह फ़ंक्शन, शीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और दिखने की सेटिंग होती है. |
add | Sheet | यह फ़ंक्शन, शीट में तय की गई कुंजी और वैल्यू के साथ डेवलपर मेटाडेटा जोड़ता है. |
add | Sheet | यह फ़ंक्शन, शीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी, वैल्यू, और दिखने की सेटिंग शामिल होती है. |
append | Sheet | यह फ़ंक्शन, शीट में मौजूद मौजूदा डेटा क्षेत्र की सबसे नीचे वाली लाइन में एक नई लाइन जोड़ता है. |
as | Data | अगर शीट का टाइप Sheet है, तो यह फ़ंक्शन शीट को Data के तौर पर दिखाता है. अगर शीट का टाइप Sheet नहीं है, तो यह फ़ंक्शन शीट को null के तौर पर दिखाता है. |
auto | Sheet | इससे दिए गए कॉलम की चौड़ाई को उसके कॉन्टेंट के हिसाब से सेट किया जाता है. |
auto | Sheet | यह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले सभी कॉलम की चौड़ाई को उनके कॉन्टेंट के हिसाब से सेट करता है. |
auto | Sheet | यह विकल्प, दी गई पंक्ति की पोज़िशन से शुरू होने वाली सभी पंक्तियों की ऊंचाई को उनके कॉन्टेंट के हिसाब से सेट करता है. |
clear() | Sheet | इससे, कॉन्टेंट और फ़ॉर्मैटिंग की जानकारी वाली शीट मिट जाती है. |
clear(options) | Sheet | यह फ़ंक्शन, दिए गए ऐडवांस विकल्पों के हिसाब से, कॉन्टेंट और/या फ़ॉर्मैट की शीट को मिटाता है. |
clear | void | इस विकल्प को चुनने पर, शीट से शर्त के साथ फ़ॉर्मैटिंग के सभी नियम हट जाते हैं. |
clear | Sheet | इससे कॉन्टेंट वाली शीट मिट जाती है. हालांकि, फ़ॉर्मैटिंग की जानकारी बनी रहती है. |
clear | Sheet | इस कुकी का इस्तेमाल, शीट से फ़ॉर्मैटिंग हटाने के लिए किया जाता है. हालांकि, इससे कॉन्टेंट पर कोई असर नहीं पड़ता. |
clear | Sheet | इस विकल्प को चुनने पर, शीट में मौजूद सभी नोट मिट जाते हैं. |
collapse | Sheet | इससे शीट पर मौजूद सभी कॉलम ग्रुप छोटे हो जाते हैं. |
collapse | Sheet | इससे शीट पर मौजूद पंक्तियों के सभी ग्रुप छोटे हो जाते हैं. |
copy | Sheet | यह फ़ंक्शन, शीट को दी गई स्प्रेडशीट में कॉपी करता है. यह स्प्रेडशीट, सोर्स स्प्रेडशीट के जैसी ही हो सकती है. |
create | Developer | यह फ़ंक्शन, इस शीट के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए Developer दिखाता है. |
create | Text | यह फ़ंक्शन, शीट के लिए टेक्स्ट फ़ाइंडर बनाता है. इसकी मदद से, शीट में टेक्स्ट को ढूंढा और बदला जा सकता है. |
delete | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन पर मौजूद कॉलम को मिटाता है. |
delete | void | यह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले कॉलम की संख्या को मिटाता है. |
delete | Sheet | यह फ़ंक्शन, दी गई लाइन की पोज़िशन पर मौजूद लाइन को मिटाता है. |
delete | void | यह फ़ंक्शन, दी गई लाइन की पोज़िशन से शुरू होने वाली कई लाइनों को मिटाता है. |
expand | Sheet | इससे शीट पर मौजूद सभी कॉलम ग्रुप बड़े हो जाते हैं. |
expand | Sheet | इससे शीट पर मौजूद सभी लाइन ग्रुप बड़े हो जाते हैं. |
expand | Sheet | यह विकल्प, दिए गए डेप्थ तक के सभी कॉलम ग्रुप को बड़ा करता है और बाकी सभी को छोटा करता है. |
expand | Sheet | इससे सभी लाइन ग्रुप को तय की गई डेप्थ तक बड़ा किया जाता है और बाकी सभी को छोटा किया जाता है. |
get | Range | यह फ़ंक्शन, इस शीट में मौजूद ऐक्टिव सेल दिखाता है. |
get | Range | यह फ़ंक्शन, चालू शीट में चुनी गई रेंज दिखाता है. अगर कोई रेंज चालू नहीं है, तो यह null दिखाता है. |
get | Range | यह फ़ंक्शन, ऐक्टिव शीट में मौजूद ऐक्टिव रेंज की सूची दिखाता है. अगर कोई ऐक्टिव रेंज मौजूद नहीं है, तो यह null दिखाता है. |
get | Banding[] | यह फ़ंक्शन, इस शीट में मौजूद सभी बैंडिंग दिखाता है. |
get | Embedded | यह फ़ंक्शन, इस शीट पर मौजूद चार्ट का कलेक्शन दिखाता है. |
get | Group|null | यह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद कॉलम ग्रुप दिखाता है. |
get | Group | यह फ़ंक्शन, शीट पर मौजूद सभी कॉलम ग्रुप के लिए Group दिखाता है. |
get | Integer | यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम की ग्रुप डेप्थ दिखाता है. |
get | Integer | यह फ़ंक्शन, दी गई कॉलम की चौड़ाई को पिक्सल में दिखाता है. |
get | Conditional | इस शीट में, शर्त के साथ फ़ॉर्मैटिंग के सभी नियम पाएं. |
get | Range|null | यह फ़ंक्शन, ऐक्टिव शीट में मौजूद मौजूदा सेल या null दिखाता है. अगर कोई मौजूदा सेल नहीं है, तो यह फ़ंक्शन null दिखाता है. |
get | Range | यह फ़ंक्शन, उन डाइमेंशन के लिए Range दिखाता है जिनमें डेटा मौजूद है. |
get | Data | इससे डेटा सोर्स के सभी फ़ॉर्मूले मिलते हैं. |
get | Data | इससे डेटा सोर्स की सभी पिवट टेबल मिलती हैं. |
get | Data | इससे डेटा सोर्स की सभी टेबल मिलती हैं. |
get | Developer | इस शीट से जुड़ा डेवलपर का सारा मेटाडेटा पाएं. |
get | Drawing[] | यह फ़ंक्शन, शीट पर मौजूद ड्रॉइंग का कलेक्शन दिखाता है. |
get | Filter|null | इस शीट में मौजूद फ़िल्टर दिखाता है. अगर कोई फ़िल्टर नहीं है, तो null दिखाता है. |
get | String|null | यह फ़ंक्शन, उस फ़ॉर्म का यूआरएल दिखाता है जो इस शीट में जवाब भेजता है. अगर इस शीट से कोई फ़ॉर्म नहीं जुड़ा है, तो यह null दिखाता है. |
get | Integer | फ़्रीज़ किए गए कॉलम की संख्या दिखाता है. |
get | Integer | इस फ़ंक्शन की मदद से, फ़्रीज़ की गई पंक्तियों की संख्या मिलती है. |
get | Over | यह फ़ंक्शन, शीट पर मौजूद सभी ओवर-द-ग्रिड इमेज दिखाता है. |
get | Integer | यह फ़ंक्शन, पैरंट स्प्रेडशीट में शीट की पोज़िशन दिखाता है. |
get | Integer | यह फ़ंक्शन, कॉन्टेंट वाले आखिरी कॉलम की पोज़िशन दिखाता है. |
get | Integer | कॉन्टेंट वाली आखिरी लाइन की पोज़िशन दिखाता है. |
get | Integer | यह फ़ंक्शन, शीट में मौजूद कॉलम की मौजूदा संख्या दिखाता है. भले ही, उनमें कोई कॉन्टेंट मौजूद हो या न हो. |
get | Integer | यह फ़ंक्शन, शीट में मौजूद पंक्तियों की मौजूदा संख्या दिखाता है. भले ही, उनमें कोई कॉन्टेंट मौजूद हो या न हो. |
get | String | यह फ़ंक्शन, शीट का नाम दिखाता है. |
get | Named | इस शीट में मौजूद सभी नेम रेंज को दिखाता है. |
get | Spreadsheet | इस शीट को शामिल करने वाली Spreadsheet दिखाता है. |
get | Pivot | यह फ़ंक्शन, इस शीट पर मौजूद सभी पिवट टेबल दिखाता है. |
get | Protection[] | यह फ़ंक्शन, शीट में सुरक्षित की गई सभी रेंज को दिखाने वाले ऑब्जेक्ट की कैटगरी या शीट की सुरक्षा को दिखाने वाली एक एलिमेंट वाली कैटगरी को दिखाता है. |
get | Range | यह फ़ंक्शन, दिए गए निर्देशांकों के हिसाब से, सबसे ऊपर बाईं ओर मौजूद सेल वाली रेंज दिखाता है. |
get | Range | यह फ़ंक्शन, दिए गए निर्देशांकों पर सबसे ऊपर मौजूद बाएं सेल वाली रेंज दिखाता है. साथ ही, इसमें पंक्तियों की दी गई संख्या भी शामिल होती है. |
get | Range | यह फ़ंक्शन, दिए गए निर्देशांकों पर सबसे ऊपर मौजूद बाएं सेल वाली रेंज दिखाता है. इस रेंज में पंक्तियों और कॉलम की संख्या भी दी गई होती है. |
get | Range | यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताई गई रेंज दिखाता है. |
get | Range | यह फ़ंक्शन, Range कलेक्शन दिखाता है. यह कलेक्शन, उसी शीट में मौजूद उन रेंज को दिखाता है जिन्हें A1 नोटेशन या R1C1 नोटेशन की ऐसी सूची से तय किया गया है जो खाली नहीं है. |
get | Group|null | यह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद पंक्ति ग्रुप दिखाता है. |
get | Group | यह फ़ंक्शन, शीट पर मौजूद सभी लाइन ग्रुप के लिए Group दिखाता है. |
get | Integer | यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद लाइन की ग्रुप डेप्थ दिखाता है. |
get | Integer | यह तरीका, दी गई लाइन की ऊंचाई को पिक्सल में दिखाता है. |
get | Selection | यह फ़ंक्शन, स्प्रेडशीट में मौजूद मौजूदा Selection दिखाता है. |
get | Integer | यह फ़ंक्शन, इस ऑब्जेक्ट से दिखाई गई शीट का आईडी दिखाता है. |
get | String | यह फ़ंक्शन, शीट का नाम दिखाता है. |
get | Object[][] | यह फ़ंक्शन, दिए गए कोऑर्डिनेट से शुरू होने वाली इस रेंज के लिए, वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है. |
get | Slicer[] | यह फ़ंक्शन, शीट पर मौजूद स्लाइसर की एक अरे दिखाता है. |
get | Color|null | यह शीट टैब का रंग दिखाता है. अगर शीट टैब का कोई रंग नहीं है, तो null दिखाता है. |
get | Sheet | यह फ़ंक्शन, शीट का टाइप दिखाता है. |
has | Boolean | अगर शीट की ग्रिडलाइन छिपी हुई हैं, तो true दिखाता है. ऐसा न होने पर, false दिखाता है. |
hide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को छिपाता है. |
hide | void | यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम को छिपाता है. |
hide | void | यह फ़ंक्शन, दिए गए इंडेक्स से शुरू होने वाले एक या उससे ज़्यादा कॉलम को छिपाता है. |
hide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों को छिपाता है. |
hide | void | दिए गए इंडेक्स पर मौजूद लाइन को छिपाता है. |
hide | void | इस फ़ंक्शन की मदद से, दिए गए इंडेक्स से शुरू होने वाली एक या उससे ज़्यादा लगातार पंक्तियों को छिपाया जा सकता है. |
hide | Sheet | इस शीट को छिपाता है. |
insert | void | इस शीट में एक नया चार्ट जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद एक कॉलम जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई कॉलम पोज़िशन से पहले एक कॉलम जोड़ता है. |
insert | void | यह फ़ंक्शन, शीट में तय की गई जगह पर एक खाली कॉलम जोड़ता है. |
insert | void | यह फ़ंक्शन, तय की गई जगह से शुरू करके, शीट में एक या उससे ज़्यादा लगातार खाली कॉलम जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद, तय किए गए कॉलम की संख्या को जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, कॉलम की दी गई पोज़िशन से पहले कई कॉलम जोड़ता है. |
insert | Over | यह फ़ंक्शन, किसी दस्तावेज़ में दी गई पंक्ति और कॉलम में Blob को इमेज के तौर पर शामिल करता है. |
insert | Over | यह फ़ंक्शन, किसी दस्तावेज़ में दी गई लाइन और कॉलम में Blob को इमेज के तौर पर शामिल करता है. साथ ही, इसमें पिक्सल ऑफ़सेट भी शामिल होता है. |
insert | Over | दस्तावेज़ में किसी दी गई पंक्ति और कॉलम में इमेज डालता है. |
insert | Over | यह फ़ंक्शन, दस्तावेज़ में किसी इमेज को तय की गई लाइन और कॉलम में पिक्सल ऑफ़सेट के साथ जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद एक पंक्ति जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले एक पंक्ति जोड़ता है. |
insert | void | यह फ़ंक्शन, किसी शीट में तय की गई जगह पर एक खाली लाइन जोड़ता है. |
insert | void | यह फ़ंक्शन, तय की गई जगह से शुरू करके, किसी शीट में एक या उससे ज़्यादा लगातार खाली पंक्तियां जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद कई पंक्तियां जोड़ता है. |
insert | Sheet | यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले कई पंक्तियां जोड़ता है. |
insert | Slicer | इस शीट में एक नया स्लाइसर जोड़ता है. |
insert | Slicer | इस शीट में एक नया स्लाइसर जोड़ता है. |
is | Boolean | यह फ़ंक्शन बताता है कि उपयोगकर्ता ने दी गई कॉलम को छिपाया है या नहीं. |
is | Boolean | अगर इस शीट का लेआउट दाएं से बाएं है, तो true दिखाता है. |
is | Boolean | यह फ़ंक्शन बताता है कि दी गई लाइन को फ़िल्टर (फ़िल्टर व्यू नहीं) की मदद से छिपाया गया है या नहीं. |
is | Boolean | इससे यह पता चलता है कि दी गई लाइन को उपयोगकर्ता ने छिपाया है या नहीं. |
is | Boolean | अगर शीट को छिपाया गया है, तो यह फ़ंक्शन true दिखाता है. |
move | void | यह फ़ंक्शन, दी गई रेंज से चुने गए कॉलम को destination से दिखाई गई जगह पर ले जाता है. |
move | void | इस फ़ंक्शन की मदद से, दी गई रेंज में चुनी गई लाइनों को destination से दिखाई गई जगह पर ले जाया जाता है. |
new | Embedded | यह फ़ंक्शन, इस शीट के लिए नया चार्ट बनाने के लिए बिल्डर दिखाता है. |
protect() | Protection | यह एक ऐसा ऑब्जेक्ट बनाता है जो शीट को उन उपयोगकर्ताओं के अलावा किसी और से सुरक्षित रख सकता है जिनके पास अनुमति है. |
remove | void | इस फ़ंक्शन का इस्तेमाल करके, पैरंट शीट से किसी चार्ट को हटाया जा सकता है. |
set | Range | यह फ़ंक्शन, चुनी गई रेंज को चालू शीट में active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर मौजूद बाएं सेल को current cell के तौर पर सेट करता है. |
set | Range | यह फ़ंक्शन, रेंज की दी गई सूची को ऐक्टिव शीट में active ranges के तौर पर सेट करता है. |
set | Range | इस शीट के लिए, चुने गए सेल की रेंज सेट करता है. |
set | Range | यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताए गए तरीके से, ऐक्टिव सेल को चुनता है. |
set | Sheet | इस विकल्प की मदद से, शीट पर कॉलम ग्रुप कंट्रोल टॉगल की पोज़िशन सेट की जाती है. |
set | Sheet | इससे, दिए गए कॉलम की चौड़ाई पिक्सल में सेट होती है. |
set | Sheet | इससे दी गई कॉलम की चौड़ाई पिक्सल में सेट की जा सकती है. |
set | void | यह फ़ंक्शन, शीट में मौजूद शर्त के साथ फ़ॉर्मैटिंग के सभी नियमों को, इनपुट नियमों से बदल देता है. |
set | Range | यह फ़ंक्शन, तय की गई सेल को current cell के तौर पर सेट करता है. |
set | void | इससे, दी गई संख्या के हिसाब से कॉलम फ़्रीज़ हो जाते हैं. |
set | void | दी गई पंक्तियों की संख्या को फ़्रीज़ करता है. |
set | Sheet | शीट की ग्रिडलाइन को छिपाता या दिखाता है. |
set | Sheet | यह कुकी, शीट का नाम सेट करती है. |
set | Sheet | इस विकल्प का इस्तेमाल करके, शीट के लेआउट को दाएं से बाएं पर सेट या अनसेट किया जाता है. |
set | Sheet | इस विकल्प की मदद से, शीट पर लाइन ग्रुप कंट्रोल टॉगल की पोज़िशन सेट की जाती है. |
set | Sheet | यह विकल्प, दी गई लाइन की ऊंचाई को पिक्सल में सेट करता है. |
set | Sheet | इससे दी गई पंक्तियों की ऊंचाई पिक्सल में सेट की जाती है. |
set | Sheet | इससे दी गई पंक्तियों की ऊंचाई पिक्सल में सेट की जाती है. |
set | Sheet | शीट टैब का रंग सेट करता है. |
set | Sheet | शीट टैब का रंग सेट करता है. |
show | void | यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम को दिखाता है. |
show | void | यह फ़ंक्शन, दिए गए इंडेक्स से शुरू होने वाले एक या उससे ज़्यादा लगातार कॉलम को दिखाता है. |
show | void | यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद लाइन को दिखाता है. |
show | void | इस फ़ंक्शन का इस्तेमाल करके, दिए गए इंडेक्स से शुरू होने वाली एक या उससे ज़्यादा लगातार पंक्तियों को दिखाया जा सकता है. |
show | Sheet | इससे शीट दिखने लगती है. |
sort(columnPosition) | Sheet | यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से बढ़ते क्रम में लगाता है. |
sort(columnPosition, ascending) | Sheet | यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से क्रम में लगाता है. |
unhide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को दिखाता है. |
unhide | void | यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्ति को दिखाता है. |
update | void | इस शीट पर मौजूद चार्ट को अपडेट करता है. |
ज़्यादा जानकारी वाला दस्तावेज़
activate()
इस शीट को चालू करता है. इससे शीट में कोई बदलाव नहीं होता. इससे सिर्फ़ पैरंट शीट में मौजूद ऐक्टिव शीट की जानकारी बदलती है.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.activate();
वापसी का टिकट
Sheet — यह नई ऐक्टिव शीट है.
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', ); // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Adds the key 'NAME' to the developer metadata for the sheet. sheet.addDeveloperMetadata('NAME'); // Gets the updated metadata info and logs it to the console. console.log(sheet.getDeveloperMetadata()[0].getKey());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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', ); // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Adds the key 'NAME' and sets the developer metadata visibility to PROJECT // for the sheet. sheet.addDeveloperMetadata( 'NAME', SpreadsheetApp.DeveloperMetadataVisibility.PROJECT, ); // Gets the updated metadata info and logs it to the console. const developerMetaData = sheet.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getVisibility().toString());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
visibility | Developer | नए डेवलपर मेटाडेटा के दिखने की स्थिति. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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', ); // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Adds the key 'COMPANY' with the value 'TECH' to the developer metadata for // the sheet. sheet.addDeveloperMetadata('COMPANY', 'TECH'); // Gets the updated metadata info and logs it to the console. const developerMetaData = sheet.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getValue());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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', ); // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Adds the key 'COMPANY' with the value 'TECH' to the developer metadata and // sets the visibility to DOCUMENT for the sheet. sheet.addDeveloperMetadata( 'COMPANY', 'TECH', SpreadsheetApp.DeveloperMetadataVisibility.DOCUMENT, ); // Gets the updated metadata info and logs it to the console. const developerMetaData = sheet.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getValue()); console.log(developerMetaData.getVisibility().toString());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
visibility | Developer | नए डेवलपर मेटाडेटा के दिखने की स्थिति. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
asDataSourceSheet()
अगर शीट का टाइप SheetType.DATASOURCE है, तो यह फ़ंक्शन शीट को DataSourceSheet के तौर पर दिखाता है. अगर शीट का टाइप SheetType.DATASOURCE नहीं है, तो यह फ़ंक्शन शीट को null के तौर पर दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can useSpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the data source sheet value if the sheet is of type // SpreadsheetApp.SheetType.DATASOURCE, otherwise this returns a null value. const dataSourceSheet = sheet.asDataSourceSheet(); // Gets the data source sheet value and logs it to the console. console.log(dataSourceSheet); console.log(sheet.getType().toString());
वापसी का टिकट
DataSourceSheet|null — डेटा सोर्स की शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
autoResizeColumns(startColumn, numColumns)
यह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले सभी कॉलम की चौड़ाई को उनके कॉन्टेंट के हिसाब से सेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sets the first 15 columns to a width that fits their text. sheet.autoResizeColumns(1, 15);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
start | Integer | वह शुरुआती कॉलम जिसका साइज़ अपने-आप बदलना है. |
num | Integer | उन कॉलम की संख्या जिनका साइज़ अपने-आप बदलना है. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
autoResizeRows(startRow, numRows)
यह विकल्प, दी गई पंक्ति की पोज़िशन से शुरू होने वाली सभी पंक्तियों की ऊंचाई को उनके कॉन्टेंट के हिसाब से सेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sets the first 15 rows to a height that fits their text. sheet.autoResizeRows(1, 15);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
start | Integer | अपने-आप साइज़ बदलने के लिए, शुरुआती पंक्ति. |
num | Integer | अपने-आप साइज़ बदलने वाली पंक्तियों की संख्या. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clear()
इससे, कॉन्टेंट और फ़ॉर्मैटिंग की जानकारी वाली शीट मिट जाती है.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clear();
वापसी का टिकट
Sheet — मिटाई गई शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clear(options)
यह फ़ंक्शन, दिए गए ऐडवांस विकल्पों के हिसाब से, कॉन्टेंट और/या फ़ॉर्मैट की शीट को मिटाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.clear({formatOnly: true, contentsOnly: true});
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
options | Object | बेहतर विकल्पों वाला JavaScript मैप. ये विकल्प यहां दिए गए हैं. |
उन्नत पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
contents | Boolean | कॉन्टेंट मिटाना है या नहीं. |
format | Boolean | क्या फ़ॉर्मैट मिटाना है. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearConditionalFormatRules()
इस विकल्प को चुनने पर, शीट से शर्त के साथ फ़ॉर्मैटिंग के सभी नियम हट जाते हैं. यह setConditionalFormatRules(rules) को कॉल करने जैसा है, जिसमें इनपुट के तौर पर खाली ऐरे दिया गया है.
const sheet = SpreadsheetApp.getActiveSheet(); sheet.clearConditionalFormatRules();
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearContents()
इससे कॉन्टेंट वाली शीट मिट जाती है. हालांकि, फ़ॉर्मैटिंग की जानकारी बनी रहती है.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clearContents();
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearFormats()
इस कुकी का इस्तेमाल, शीट से फ़ॉर्मैटिंग हटाने के लिए किया जाता है. हालांकि, इससे कॉन्टेंट पर कोई असर नहीं पड़ता.
फ़ॉर्मैटिंग का मतलब है कि "फ़ॉर्मैट" मेन्यू में दिए गए विकल्पों के हिसाब से डेटा को कैसे फ़ॉर्मैट किया जाता है. जैसे: बोल्ड, इटैलिक, शर्त के साथ फ़ॉर्मैटिंग. इसका मतलब सेल की चौड़ाई या ऊंचाई नहीं है.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clearFormats();
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearNotes()
इस विकल्प को चुनने पर, शीट में मौजूद सभी नोट मिट जाते हैं.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clearNotes();
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
collapseAllColumnGroups()
इससे शीट पर मौजूद सभी कॉलम ग्रुप छोटे हो जाते हैं.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // All column groups on the sheet are collapsed. sheet.collapseAllColumnGroups();
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
collapseAllRowGroups()
इससे शीट पर मौजूद पंक्तियों के सभी ग्रुप छोटे हो जाते हैं.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // All row groups on the sheet are collapsed. sheet.collapseAllRowGroups();
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
copyTo(spreadsheet)
यह फ़ंक्शन, शीट को दी गई स्प्रेडशीट में कॉपी करता है. यह स्प्रेडशीट, सोर्स स्प्रेडशीट के जैसी ही हो सकती है. कॉपी की गई शीट का नाम "[original name] की कॉपी" होता है.
const source = SpreadsheetApp.getActiveSpreadsheet(); const sheet = source.getSheets()[0]; const destination = SpreadsheetApp.openById('ID_GOES HERE'); sheet.copyTo(destination);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
spreadsheet | Spreadsheet | वह स्प्रेडशीट जिसमें इस शीट को कॉपी करना है. यह सोर्स स्प्रेडशीट भी हो सकती है. |
वापसी का टिकट
Sheet — यह नई शीट है, जिसका इस्तेमाल चेन बनाने के लिए किया जाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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', ); // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Adds developer metadata for testing. sheet.addDeveloperMetadata('CITY', 'PARIS'); // Creates the developer metadata finder. const metadatafinder = sheet.createDeveloperMetadataFinder(); // Finds the metadata with value 'PARIS' and displays its key in the console. console.log(metadatafinder.withValue('PARIS').find()[0].getKey());
वापसी का टिकट
DeveloperMetadataFinder — यह डेवलपर मेटाडेटा ढूंढने वाला टूल है. इसकी मदद से, इस शीट के दायरे में मेटाडेटा खोजा जा सकता है.
createTextFinder(findText)
यह फ़ंक्शन, शीट के लिए टेक्स्ट फ़ाइंडर बनाता है. इसकी मदद से, शीट में टेक्स्ट को ढूंढा और बदला जा सकता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // Creates a text finder. const textFinder = sheet.createTextFinder('dog'); // Returns the first occurrence of 'dog' in the sheet. const firstOccurrence = textFinder.findNext(); // Replaces the last found occurrence of 'dog' with 'cat' and returns the number // of occurrences replaced. const numOccurrencesReplaced = firstOccurrence.replaceWith('cat');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
find | String | वह टेक्स्ट जिसे खोजना है. |
वापसी का टिकट
TextFinder — यह शीट का TextFinder है.
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
expandAllColumnGroups()
इससे शीट पर मौजूद सभी कॉलम ग्रुप बड़े हो जाते हैं. इस तरीके के लिए, कम से कम एक कॉलम ग्रुप होना ज़रूरी है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // All column groups on the sheet are expanded. sheet.expandAllColumnGroups();
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
expandAllRowGroups()
इससे शीट पर मौजूद सभी लाइन ग्रुप बड़े हो जाते हैं. इस तरीके के लिए, कम से कम एक लाइन ग्रुप होना ज़रूरी है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // All row groups on the sheet are expanded. sheet.expandAllRowGroups();
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
expandColumnGroupsUpToDepth(groupDepth)
यह विकल्प, दिए गए डेप्थ तक के सभी कॉलम ग्रुप को बड़ा करता है और बाकी सभी को छोटा करता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // All column groups of depth 2 and lower are expanded, and groups with depth // 3 and higher are collapsed. sheet.expandColumnGroupsUpToDepth(2);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
group | Integer | कॉलम ग्रुप को किस डेप्थ तक बड़ा करना है. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
expandRowGroupsUpToDepth(groupDepth)
इससे सभी लाइन ग्रुप को तय की गई डेप्थ तक बड़ा किया जाता है और बाकी सभी को छोटा किया जाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // All row groups of depth 2 and lower are expanded, and groups with depth // 3 and higher are collapsed. sheet.expandRowGroupsUpToDepth(2);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
group | Integer | ग्रुप की गहराई, जहां तक पंक्ति ग्रुप को बड़ा करना है. |
वापसी का टिकट
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
इन्हें भी देखें
getBandings()
यह फ़ंक्शन, इस शीट में मौजूद सभी बैंडिंग दिखाता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the banding info for the sheet. const bandings = sheet.getBandings(); // Gets info on the bandings' second row color and logs it to the console. for (const banding of bandings) { console.log(banding.getSecondRowColor()); }
वापसी का टिकट
Banding[] — इस शीट में मौजूद सभी बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getCharts()
यह फ़ंक्शन, इस शीट पर मौजूद चार्ट का कलेक्शन दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const charts = sheet.getCharts(); for (const i in charts) { const chart = charts[i]; // Do something with the chart }
वापसी का टिकट
EmbeddedChart[] — चार्ट का ऐरे.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getColumnGroup(columnIndex, groupDepth)
यह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद कॉलम ग्रुप दिखाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // Returns the group whose control index is at column 2 and has a depth of 1, or // null if the group doesn’t exist. const columnGroup = sheet.getColumnGroup(2, 1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | ग्रुप कंट्रोल टॉगल का कॉलम इंडेक्स या ग्रुप में मौजूद कोई इंडेक्स. |
group | Integer | ग्रुप की डेप्थ. |
वापसी का टिकट
Group|null — कंट्रोल इंडेक्स और डेप्थ पर मौजूद कॉलम ग्रुप या अगर ग्रुप मौजूद नहीं है, तो अपवाद दिखाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getColumnGroupControlPosition()
यह फ़ंक्शन, शीट पर मौजूद सभी कॉलम ग्रुप के लिए GroupControlTogglePosition दिखाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // GroupControlTogglePosition.AFTER if the column grouping control toggle is // shown after the group. const columnGroupControlPosition = sheet.getColumnGroupControlPosition();
वापसी का टिकट
GroupControlTogglePosition — true अगर इस शीट पर ग्रुप के बाद कॉलम ग्रुपिंग कंट्रोल टॉगल दिखाया जाता है और false ऐसा न होने पर.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getColumnGroupDepth(columnIndex)
यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम की ग्रुप डेप्थ दिखाता है.
ग्रुप डेप्थ से पता चलता है कि कॉलम में कितने ग्रुप ओवरलैप होते हैं. यह वैल्यू शून्य से आठ के बीच हो सकती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // 1 if there is a group over columns 1 through 3 const groupDepth = sheet.getColumnGroupDepth(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | कॉलम का इंडेक्स. |
वापसी का टिकट
Integer — दिए गए इंडेक्स पर मौजूद कॉलम की ग्रुप डेप्थ.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
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
getConditionalFormatRules()
इस शीट में, शर्त के साथ फ़ॉर्मैटिंग के सभी नियम पाएं.
// Logs the conditional format rules in a sheet. const rules = SpreadsheetApp.getActiveSheet().getConditionalFormatRules(); for (let i = 0; i < rules.length; i++) { const rule = rules[i]; Logger.log(rule); }
वापसी का टिकट
ConditionalFormatRule[] — यह शीट में मौजूद सभी नियमों का कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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(); // Lo gs the first data source formulain 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
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
getDeveloperMetadata()
इस शीट से जुड़ा डेवलपर का सारा मेटाडेटा पाएं.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Adds developer metadata for testing. sheet.addDeveloperMetadata('CITY', 'PARIS'); // Gets all the developer metadata for the sheet. const developerMetaDataList = sheet.getDeveloperMetadata(); // Logs the developer metadata to the console. for (const developerMetaData of developerMetaDataList) { console.log(developerMetaData.getKey()); }
वापसी का टिकट
DeveloperMetadata[] — इस शीट से जुड़ा डेवलपर मेटाडेटा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDrawings()
यह फ़ंक्शन, शीट पर मौजूद ड्रॉइंग का कलेक्शन दिखाता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets all the drawings from the sheet. const allDrawings = sheet.getDrawings(); // Logs the number of drawings present on the sheet. console.log(allDrawings.length);
वापसी का टिकट
Drawing[] — इस शीट पर मौजूद ड्रॉइंग की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFilter()
इस शीट में मौजूद फ़िल्टर दिखाता है. अगर कोई फ़िल्टर नहीं है, तो null दिखाता है.
// Gets the filter on the active sheet. const ss = SpreadsheetApp.getActiveSheet(); const filter = ss.getFilter();
वापसी का टिकट
Filter|null — फ़िल्टर.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFormUrl()
यह फ़ंक्शन, उस फ़ॉर्म का यूआरएल दिखाता है जो इस शीट में जवाब भेजता है. अगर इस शीट से कोई फ़ॉर्म नहीं जुड़ा है, तो यह null दिखाता है. अगर उपयोगकर्ता के पास स्प्रेडशीट में बदलाव करने की अनुमति नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है.
const sheet = SpreadsheetApp.getActiveSheet(); const url = sheet.getFormUrl();
वापसी का टिकट
String|null — वह यूआरएल जो इस शीट में जवाबों को शामिल करने वाले फ़ॉर्म के लिए है या 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
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
getIndex()
यह फ़ंक्शन, पैरंट स्प्रेडशीट में शीट की पोज़िशन दिखाता है. 1 से शुरू होता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); // Note that the JavaScript index is 0, but this logs 1 const sheet = ss.getSheets()[0]; // ... because spreadsheets are 1-indexed Logger.log(sheet.getIndex());
वापसी का टिकट
Integer — पैरंट स्प्रेडशीट में शीट की पोज़िशन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
getMaxColumns()
यह फ़ंक्शन, शीट में मौजूद कॉलम की मौजूदा संख्या दिखाता है. भले ही, उनमें कोई कॉन्टेंट मौजूद हो या न हो.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); Logger.log(first.getMaxColumns());
वापसी का टिकट
Integer — शीट की ज़्यादा से ज़्यादा चौड़ाई.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getMaxRows()
यह फ़ंक्शन, शीट में मौजूद पंक्तियों की मौजूदा संख्या दिखाता है. भले ही, उनमें कोई कॉन्टेंट मौजूद हो या न हो.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); Logger.log(first.getMaxRows());
वापसी का टिकट
Integer — शीट की ज़्यादा से ज़्यादा ऊंचाई.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getName()
यह फ़ंक्शन, शीट का नाम दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; Logger.log(sheet.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.getActiveSheet().getNamedRanges(); if (namedRanges.length > 1) { Logger.log(namedRanges[0].getName()); }
वापसी का टिकट
NamedRange[] — यह शीट में मौजूद सभी नामित श्रेणियों की एक कैटगरी होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getParent()
इस शीट को शामिल करने वाली Spreadsheet दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // parent is identical to ss const parent = sheet.getParent();
वापसी का टिकट
Spreadsheet — पैरंट स्प्रेडशीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getPivotTables()
यह फ़ंक्शन, इस शीट पर मौजूद सभी पिवट टेबल दिखाता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets all the pivot table info for the sheet. const pivotTables = sheet.getPivotTables(); // Logs the pivot tables to the console. for (const pivotTable of pivotTables) { console.log(pivotTable.getSourceDataRange().getValues()); }
वापसी का टिकट
PivotTable[] — इस शीट में मौजूद पिवट टेबल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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 sheet = SpreadsheetApp.getActiveSheet(); const protections = sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE); for (let i = 0; i < protections.length; i++) { const protection = protections[i]; if (protection.canEdit()) { protection.remove(); } }
// Remove sheet protection from the active sheet, if the user has permission to // edit it. const sheet = SpreadsheetApp.getActiveSheet(); const protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0]; if (protection?.canEdit()) { protection.remove(); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
type | Protection | संरक्षित क्षेत्र का टाइप, Spreadsheet या
Spreadsheet. |
वापसी का टिकट
Protection[] — यह शीट में सुरक्षित की गई सभी रेंज को दिखाने वाले ऑब्जेक्ट की एक कैटगरी होती है. इसके अलावा, यह एक एलिमेंट वाली कैटगरी भी हो सकती है, जो शीट को सुरक्षित रखने की सुविधा के बारे में बताती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRange(row, column)
यह फ़ंक्शन, दिए गए निर्देशांकों के हिसाब से, सबसे ऊपर बाईं ओर मौजूद सेल वाली रेंज दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Passing only two arguments returns a "range" with a single cell. const range = sheet.getRange(1, 1); const values = range.getValues(); Logger.log(values[0][0]);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | वह सेल जिसका इंडेक्स दिखाना है; पंक्ति इंडेक्सिंग 1 से शुरू होती है. |
column | Integer | लौटाई जाने वाली सेल का कॉलम इंडेक्स; कॉलम इंडेक्सिंग 1 से शुरू होती है. |
वापसी का टिकट
Range — यह सिर्फ़ इस सेल वाली रेंज होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRange(row, column, numRows)
यह फ़ंक्शन, दिए गए निर्देशांकों पर सबसे ऊपर मौजूद बाएं सेल वाली रेंज दिखाता है. साथ ही, इसमें पंक्तियों की दी गई संख्या भी शामिल होती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // When the "numRows" argument is used, only a single column of data is // returned. const range = sheet.getRange(1, 1, 3); const values = range.getValues(); // Prints 3 values from the first column, starting from row 1. for (const row in values) { for (const col in values[row]) { Logger.log(values[row][col]); } }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह रेंज की शुरुआती लाइन का इंडेक्स होता है. लाइन इंडेक्सिंग की शुरुआत 1 से होती है. |
column | Integer | यह रेंज का कॉलम इंडेक्स होता है. कॉलम इंडेक्सिंग की शुरुआत 1 से होती है. |
num | Integer | लौटाई जाने वाली पंक्तियों की संख्या. |
वापसी का टिकट
Range — यह एक ऐसी रेंज होती है जिसमें डेटा का एक कॉलम होता है. इसमें पंक्तियों की संख्या तय की जाती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRange(row, column, numRows, numColumns)
यह फ़ंक्शन, दिए गए निर्देशांकों पर सबसे ऊपर मौजूद बाएं सेल वाली रेंज दिखाता है. इस रेंज में पंक्तियों और कॉलम की संख्या भी दी गई होती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange(1, 1, 3, 3); const values = range.getValues(); // Print values from a 3x3 box. for (const row in values) { for (const col in values[row]) { Logger.log(values[row][col]); } }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह रेंज की शुरुआती लाइन का इंडेक्स होता है. लाइन इंडेक्सिंग की शुरुआत 1 से होती है. |
column | Integer | रेंज का शुरुआती कॉलम इंडेक्स. कॉलम इंडेक्सिंग 1 से शुरू होती है. |
num | Integer | लौटाई जाने वाली पंक्तियों की संख्या. |
num | Integer | कितने कॉलम लौटाने हैं, इसे बताने वाली संख्या. |
वापसी का टिकट
Range — यह तय किए गए क्षेत्र के हिसाब से रेंज होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
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
getRowGroup(rowIndex, groupDepth)
यह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद पंक्ति ग्रुप दिखाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // Returns the group whose control index is at row 2 and has a depth of 1, or // null if the group doesn’t exist. const rowGroup = sheet.getRowGroup(2, 1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | ग्रुप कंट्रोल टॉगल का लाइन इंडेक्स या ग्रुप में मौजूद कोई इंडेक्स. |
group | Integer | ग्रुप की डेप्थ. |
वापसी का टिकट
Group|null — कंट्रोल इंडेक्स और डेप्थ पर मौजूद लाइन ग्रुप या अगर ग्रुप मौजूद नहीं है, तो अपवाद दिखाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRowGroupControlPosition()
यह फ़ंक्शन, शीट पर मौजूद सभी लाइन ग्रुप के लिए GroupControlTogglePosition दिखाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // GroupControlTogglePosition.AFTER if the row grouping control toggle is shown // after the group. const rowGroupControlPosition = sheet.getRowGroupControlPosition();
वापसी का टिकट
GroupControlTogglePosition — true अगर इस शीट पर ग्रुप के बाद लाइन ग्रुपिंग कंट्रोल टॉगल दिखाया जाता है
और false ऐसा न होने पर.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRowGroupDepth(rowIndex)
यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद लाइन की ग्रुप डेप्थ दिखाता है.
ग्रुप डेप्थ से पता चलता है कि कितनी पंक्तियां एक-दूसरे से ओवरलैप हो रही हैं. यह वैल्यू शून्य से आठ के बीच हो सकती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // 1 if there is a group over rows 1 through 3 const groupDepth = sheet.getRowGroupDepth(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | लाइन का इंडेक्स. |
वापसी का टिकट
Integer — दिए गए इंडेक्स पर मौजूद लाइन के ग्रुप की डेप्थ.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
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
getSlicers()
यह फ़ंक्शन, शीट पर मौजूद स्लाइसर की एक अरे दिखाता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets all slicers in the spreadsheet. const slicers = sheet.getSlicers(); // Logs the slicer titles to the console. for (const slicer of slicers) { console.log(slicer.getTitle()); }
वापसी का टिकट
Slicer[] — इस शीट पर मौजूद स्लाइसर की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getTabColorObject()
यह शीट टैब का रंग दिखाता है. अगर शीट टैब का कोई रंग नहीं है, तो null दिखाता है.
// This example assumes there is a sheet named "Sheet1" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('Sheet1'); const color = first.getTabColorObject();
वापसी का टिकट
Color|null — शीट टैब का रंग या null, अगर शीट टैब में कोई रंग नहीं है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getType()
यह फ़ंक्शन, शीट का टाइप दिखाता है.
डिफ़ॉल्ट रूप से, शीट का टाइप SheetType.GRID होता है. जिस शीट में सिर्फ़ एक एम्बेड किया गया ऑब्जेक्ट होता है, जैसे कि EmbeddedChart, उसे SheetType.OBJECT शीट कहते हैं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; Logger.log(sheet.getType());
वापसी का टिकट
SheetType — यह शीट का टाइप है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
hasHiddenGridlines()
अगर शीट की ग्रिडलाइन छिपी हुई हैं, तो true दिखाता है. ऐसा न होने पर, false दिखाता है.
ग्रिडलाइन डिफ़ॉल्ट रूप से दिखती हैं.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Checks if the spreadsheet has hidden gridelines and logs the result to the // console. console.log(sheet.hasHiddenGridlines());
वापसी का टिकट
Boolean — अगर ग्रिडलाइन छिपी हुई हैं, तो true; अगर ग्रिडलाइन नहीं छिपी हुई हैं, तो false.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
hideColumns(columnIndex)
यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम को छिपाता है. इस तरीके के लिए, 1-इंडेक्स का इस्तेमाल करें.
इंडेक्स का इस्तेमाल करके एक से ज़्यादा कॉलम छिपाने के लिए, hideColumns(columnIndex, numColumns) का इस्तेमाल करें.
किसी रेंज का इस्तेमाल करके एक से ज़्यादा कॉलम छिपाने के लिए, hideColumn() का इस्तेमाल करें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first column sheet.hideColumns(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | छिपाए जाने वाले कॉलम का इंडेक्स. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
hideColumns(columnIndex, numColumns)
यह फ़ंक्शन, दिए गए इंडेक्स से शुरू होने वाले एक या उससे ज़्यादा कॉलम को छिपाता है. इस तरीके के लिए, 1-इंडेक्स का इस्तेमाल करें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first three columns sheet.hideColumns(1, 3);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | उन कॉलम का शुरुआती इंडेक्स जिन्हें छिपाना है. |
num | Integer | छिपाए जाने वाले कॉलम की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
hideRows(rowIndex)
दिए गए इंडेक्स पर मौजूद लाइन को छिपाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first row sheet.hideRows(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | छिपाने के लिए लाइन का इंडेक्स. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
hideRows(rowIndex, numRows)
इस फ़ंक्शन की मदद से, दिए गए इंडेक्स से शुरू होने वाली एक या उससे ज़्यादा लगातार पंक्तियों को छिपाया जा सकता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first three rows sheet.hideRows(1, 3);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | छुपाई जाने वाली पंक्तियों का शुरुआती इंडेक्स. |
num | Integer | छिपाने के लिए पंक्तियों की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
hideSheet()
इस शीट को छिपाता है. अगर शीट पहले से छिपी हुई है, तो इस विकल्प का कोई असर नहीं होता. अगर इस तरीके को सिर्फ़ दिखने वाली शीट पर कॉल किया जाता है, तो यह एक अपवाद दिखाता है.
const sheet = SpreadsheetApp.getActiveSheet(); sheet.hideSheet();
वापसी का टिकट
Sheet — मौजूदा शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertChart(chart)
इस शीट में एक नया चार्ट जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This creates a simple bar chart from the first three rows // of the first two columns of the spreadsheet const chart = sheet.newChart() .setChartType(Charts.ChartType.BAR) .addRange(sheet.getRange('A1:B4')) .setPosition(5, 5, 0, 0) .setOption('title', 'Dynamic Chart') .build(); sheet.insertChart(chart);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
chart | Embedded | शामिल किया जाने वाला चार्ट. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
insertColumns(columnIndex)
यह फ़ंक्शन, शीट में तय की गई जगह पर एक खाली कॉलम जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all columns by one sheet.insertColumns(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | वह इंडेक्स जिससे पता चलता है कि कॉलम कहां जोड़ना है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertColumns(columnIndex, numColumns)
यह फ़ंक्शन, तय की गई जगह से शुरू करके, शीट में एक या उससे ज़्यादा लगातार खाली कॉलम जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all columns by three sheet.insertColumns(1, 3);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | वह इंडेक्स जिससे पता चलता है कि कॉलम कहां जोड़ना है. |
num | Integer | कॉलम की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
insertImage(blobSource, column, row)
यह फ़ंक्शन, किसी दस्तावेज़ में दी गई पंक्ति और कॉलम में BlobSource को इमेज के तौर पर शामिल करता है. इमेज का साइज़, 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)
यह फ़ंक्शन, किसी दस्तावेज़ में दी गई लाइन और कॉलम में BlobSource को इमेज के तौर पर शामिल करता है. साथ ही, इसमें पिक्सल ऑफ़सेट भी शामिल होता है. इमेज का साइज़, 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
insertRows(rowIndex)
यह फ़ंक्शन, किसी शीट में तय की गई जगह पर एक खाली लाइन जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all rows down by one sheet.insertRows(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह इंडेक्स बताता है कि लाइन कहां जोड़नी है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertRows(rowIndex, numRows)
यह फ़ंक्शन, तय की गई जगह से शुरू करके, किसी शीट में एक या उससे ज़्यादा लगातार खाली पंक्तियां जोड़ता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all rows down by three sheet.insertRows(1, 3);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह इंडेक्स बताता है कि लाइन कहां जोड़नी है. |
num | Integer | डालने के लिए पंक्तियों की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
insertSlicer(range, anchorRowPos, anchorColPos)
इस शीट में एक नया स्लाइसर जोड़ता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range of the sheet. const range = sheet.getRange('A1:D10'); // Inserts the slicer with a random range into the sheet. const insertSlicers = sheet.insertSlicer(range.randomize(), 1, 10); // Logs the insert slicer result to the console. console.log(insertSlicers);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
range | Range | वह रेंज जिस पर स्लाइसर बनाया गया है. |
anchor | Integer | स्लाइसर का ऊपरी हिस्सा इस लाइन में ऐंकर किया गया है. |
anchor | Integer | स्लाइसर का ऊपरी हिस्सा इस कॉलम में ऐंकर किया गया है. |
वापसी का टिकट
Slicer — नया स्लाइसर डाला गया.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertSlicer(range, anchorRowPos, anchorColPos, offsetX, offsetY)
इस शीट में एक नया स्लाइसर जोड़ता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range. const range = sheet.getRange('A1:D10'); // Inserts a slicer using the random range function. const insertSlicers = sheet.insertSlicer(range.randomize(), 1, 10, 0, 0); // Logs the insert slicer result to the console. console.log(insertSlicers);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
range | Range | वह रेंज जिस पर स्लाइसर बनाया गया है. |
anchor | Integer | स्लाइसर का ऊपरी हिस्सा इस लाइन में ऐंकर किया गया है. |
anchor | Integer | स्लाइसर का ऊपरी हिस्सा इस कॉलम में ऐंकर किया गया है. |
offsetX | Integer | सेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट, पिक्सल में. |
offsetY | Integer | सेल के कोने से वर्टिकल ऑफ़सेट, पिक्सल में. |
वापसी का टिकट
Slicer — नया स्लाइसर डाला गया.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
isRightToLeft()
अगर इस शीट का लेआउट दाएं से बाएं है, तो true दिखाता है. अगर शीट में डिफ़ॉल्ट रूप से बाएं से दाएं वाला लेआउट इस्तेमाल किया जाता है, तो रिस्पॉन्स के तौर पर false मिलता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Checks if a spreadsheet is ordered from right to left and logs the result to // the console. console.log(sheet.isRightToLeft());
वापसी का टिकट
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
isSheetHidden()
अगर शीट को छिपाया गया है, तो यह फ़ंक्शन true दिखाता है.
const sheet = SpreadsheetApp.getActiveSheet(); if (sheet.isSheetHidden()) { // do something... }
वापसी का टिकट
Boolean — अगर शीट छिपी हुई है, तो true. अगर शीट नहीं छिपी हुई है, तो false.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
moveColumns(columnSpec, destinationIndex)
यह फ़ंक्शन, दी गई रेंज से चुने गए कॉलम को destinationIndex से दिखाई गई जगह पर ले जाता है. columnSpec को पूरे कॉलम या कॉलम के ग्रुप को सटीक तरीके से दिखाने की ज़रूरत नहीं होती. यह उन सभी कॉलम को चुनता है जिनमें रेंज शामिल होती है.
// The code below moves rows A-B to destination index 5. // This results in those columns becoming columns C-D. const sheet = SpreadsheetApp.getActiveSheet(); // Selects column A and column B to be moved. const columnSpec = sheet.getRange('A1:B1'); sheet.moveColumns(columnSpec, 5);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Range | उन कॉलम की रेंज जिन्हें मूव करना है. |
destination | Integer | वह इंडेक्स जहां कॉलम को ले जाना है. ध्यान दें कि यह इंडेक्स, कॉलम को ले जाने से पहले के निर्देशांकों पर आधारित होता है. मौजूदा डेटा को दाईं ओर ले जाया जाता है, ताकि ले जाए गए कॉलम के लिए जगह बन सके. साथ ही, सोर्स कॉलम को ग्रिड से हटा दिया जाता है. इसलिए, हो सकता है कि डेटा, मूल रूप से तय किए गए इंडेक्स से अलग इंडेक्स पर पहुंच जाए. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
moveRows(rowSpec, destinationIndex)
इस फ़ंक्शन की मदद से, दी गई रेंज में चुनी गई लाइनों को destinationIndex से दिखाई गई जगह पर ले जाया जाता है. rowSpec को किसी पूरी लाइन या लाइनों के ग्रुप को मूव करने के लिए, उसे सटीक तरीके से दिखाने की ज़रूरत नहीं होती. यह उन सभी लाइनों को चुनता है जो रेंज में शामिल होती हैं.
// The code below moves rows 1-2 to destination index 5. // This results in those rows becoming rows 3-4. const sheet = SpreadsheetApp.getActiveSheet(); // Selects row 1 and row 2 to be moved. const rowSpec = sheet.getRange('A1:A2'); sheet.moveRows(rowSpec, 5);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Range | वह रेंज जिसमें उन पंक्तियों को शामिल किया गया है जिन्हें दूसरी जगह ले जाना है. |
destination | Integer | वह इंडेक्स जहां पंक्तियों को ले जाना है. ध्यान दें कि यह इंडेक्स, लाइनों को दूसरी जगह ले जाने से पहले के निर्देशांकों पर आधारित होता है. मौजूदा डेटा को नीचे की ओर ले जाया जाता है, ताकि ट्रांसफ़र की गई लाइनों के लिए जगह बन सके. वहीं, सोर्स लाइनों को ग्रिड से हटा दिया जाता है. इसलिए, हो सकता है कि डेटा, मूल रूप से तय किए गए इंडेक्स से अलग इंडेक्स पर पहुंच जाए. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
newChart()
यह फ़ंक्शन, इस शीट के लिए नया चार्ट बनाने के लिए बिल्डर दिखाता है.
इस उदाहरण में, नया चार्ट बनाने का तरीका बताया गया है:
const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('A1:B8'); const chartBuilder = sheet.newChart(); chartBuilder.addRange(range) .setChartType(Charts.ChartType.LINE) .setPosition(2, 2, 0, 0) .setOption('title', 'My Line Chart!'); sheet.insertChart(chartBuilder.build());
वापसी का टिकट
EmbeddedChartBuilder — यह एक बिल्डर है, जिसकी मदद से नया चार्ट बनाया जा सकता है.
protect()
यह एक ऐसा ऑब्जेक्ट बनाता है जो शीट को उन उपयोगकर्ताओं के अलावा किसी और से सुरक्षित रख सकता है जिनके पास अनुमति है. जब तक स्क्रिप्ट, शीट के एडिटर की सूची में बदलाव नहीं करती (Protection.removeEditor(emailAddress), Protection.removeEditor(user), Protection.removeEditors(emailAddresses), Protection.addEditor(emailAddress), Protection.addEditor(user), Protection.addEditors(emailAddresses) को कॉल करके या Protection.setDomainEdit(editable) के लिए नई वैल्यू सेट करके), तब तक अनुमतियां स्प्रेडशीट की अनुमतियों के जैसी ही होती हैं. इसका मतलब है कि शीट सुरक्षित नहीं रहती. अगर शीट पहले से सुरक्षित है, तो यह तरीका सुरक्षा की मौजूदा सेटिंग को दिखाने वाला ऑब्जेक्ट दिखाता है.
सुरक्षित की गई किसी शीट में, असुरक्षित किए गए हिस्से शामिल हो सकते हैं.
// Protect the active sheet, then remove all other users from the list of // editors. const sheet = SpreadsheetApp.getActiveSheet(); const protection = sheet.protect().setDescription('Sample protected sheet'); // Ensure the current user is an editor before removing others. Otherwise, if // the user's edit permission comes from a group, the script throws an exception // upon removing the group. const me = Session.getEffectiveUser(); protection.addEditor(me); protection.removeEditors(protection.getEditors()); if (protection.canDomainEdit()) { protection.setDomainEdit(false); }
वापसी का टिकट
Protection — यह सुरक्षा सेटिंग को दिखाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeChart(chart)
इस फ़ंक्शन का इस्तेमाल करके, पैरंट शीट से किसी चार्ट को हटाया जा सकता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This removes all the embedded charts from the spreadsheet const charts = sheet.getCharts(); for (const i in charts) { sheet.removeChart(charts[i]); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
chart | Embedded | वह चार्ट जिसे हटाना है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
setColumnGroupControlPosition(position)
इस विकल्प की मदद से, शीट पर कॉलम ग्रुप कंट्रोल टॉगल की पोज़िशन सेट की जाती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; sheet.setColumnGroupControlPosition( SpreadsheetApp.GroupControlTogglePosition.AFTER, );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
position | Group | कॉलम ग्रुप कंट्रोल टॉगल की पोज़िशन. |
वापसी का टिकट
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
setColumnWidths(startColumn, numColumns, width)
इससे दी गई कॉलम की चौड़ाई पिक्सल में सेट की जा सकती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sets the first three columns to a width of 200 pixels sheet.setColumnWidths(1, 3, 200);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
start | Integer | बदलाव करने के लिए, कॉलम की शुरुआती पोज़िशन. |
num | Integer | बदले जाने वाले कॉलम की संख्या. |
width | Integer | चौड़ाई को पिक्सल में सेट करने के लिए. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setConditionalFormatRules(rules)
यह फ़ंक्शन, शीट में मौजूद शर्त के साथ फ़ॉर्मैटिंग के सभी नियमों को, इनपुट नियमों से बदल देता है. नियमों का आकलन, उनके इनपुट के क्रम के हिसाब से किया जाता है.
// Remove one of the existing conditional format rules. const sheet = SpreadsheetApp.getActiveSheet(); const rules = sheet.getConditionalFormatRules(); rules.splice(1, 1); // Deletes the 2nd format rule. sheet.setConditionalFormatRules(rules);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
rules | Conditional | शर्त के साथ फ़ॉर्मैटिंग के नए नियम. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
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
setHiddenGridlines(hideGridlines)
शीट की ग्रिडलाइन को छिपाता या दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can us eSpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Hides the gridlines in the sheet. sheet.setHiddenGridlines(true);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
hide | Boolean | अगर true है, तो इस शीट में ग्रिडलाइन छिपाएं. अगर true नहीं है, तो ग्रिडलाइन दिखाएं. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setName(name)
यह कुकी, शीट का नाम सेट करती है.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.setName('not first anymore');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
name | String | शीट का नया नाम. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRightToLeft(rightToLeft)
इस विकल्प का इस्तेमाल करके, शीट के लेआउट को दाएं से बाएं पर सेट या अनसेट किया जाता है.
// 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 a sheet by its name. const sheet = ss.getSheetByName('Sheet1'); // Sets the sheet layout, so that the sheet is ordered from right to left. sheet.setRightToLeft(true);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
right | Boolean | अगर true है, तो शीट का लेआउट दाईं से बाईं ओर सेट होता है. इसमें सेल A1, सबसे ऊपर दाएं कोने में होता है. अगर false है, तो शीट का लेआउट डिफ़ॉल्ट रूप से बाएं से दाएं पर सेट होता है. इसमें सेल A1 सबसे ऊपर बाईं ओर होता है. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRowGroupControlPosition(position)
इस विकल्प की मदद से, शीट पर लाइन ग्रुप कंट्रोल टॉगल की पोज़िशन सेट की जाती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; sheet.setRowGroupControlPosition( SpreadsheetApp.GroupControlTogglePosition.AFTER, );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
position | Group | लाइन ग्रुप कंट्रोल टॉगल की जगह. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRowHeight(rowPosition, height)
यह विकल्प, दी गई लाइन की ऊंचाई को पिक्सल में सेट करता है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियों की ऊंचाई बढ़ जाती है. अगर आपको पंक्तियों को किसी तय ऊंचाई पर सेट करना है, तो 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
setRowHeights(startRow, numRows, height)
इससे दी गई पंक्तियों की ऊंचाई पिक्सल में सेट की जाती है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियों की ऊंचाई बढ़ जाती है. अगर आपको पंक्तियों की ऊंचाई तय करनी है, तो setRowHeightsForced(startRow, numRows, height) का इस्तेमाल करें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sets the first three rows to a height of 20 pixels sheet.setRowHeights(1, 3, 20);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
start | Integer | बदलाव करने के लिए, शुरुआती लाइन की पोज़िशन. |
num | Integer | बदली जाने वाली पंक्तियों की संख्या. |
height | Integer | इसे सेट करने के लिए पिक्सल में ऊंचाई. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRowHeightsForced(startRow, numRows, height)
इससे दी गई पंक्तियों की ऊंचाई पिक्सल में सेट की जाती है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियों की ऊंचाई बढ़ जाती है. setRowHeightsForced का इस्तेमाल करने पर, पंक्तियों की ऊंचाई को तय की गई ऊंचाई पर सेट कर दिया जाता है. भले ही, सेल का कॉन्टेंट पंक्ति की ऊंचाई से ज़्यादा हो.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Sets the first three rows to a height of 5 pixels. sheet.setRowHeightsForced(1, 3, 5);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
start | Integer | बदलाव करने के लिए, शुरुआती लाइन की पोज़िशन. |
num | Integer | बदली जाने वाली पंक्तियों की संख्या. |
height | Integer | इसे सेट करने के लिए पिक्सल में ऊंचाई. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTabColor(color)
शीट टैब का रंग सेट करता है.
// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.setTabColor('ff0000'); // Set the color to red. first.setTabColor(null); // Unset the color.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | String | सीएसएस नोटेशन में रंग का कोड (जैसे, '#ffffff' या 'white') या
टैब के रंग को रीसेट करने के लिए null. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTabColorObject(color)
शीट टैब का रंग सेट करता है.
// This example assumes there is a sheet named "Sheet1" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('Sheet1'); const color = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1) .build(); first.setTabColorObject(color); // Set the color to theme accent 1. first.setTabColorObject(null); // Unset the color.
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | Color | सेट करने के लिए शीट टैब का रंग. |
वापसी का टिकट
Sheet — यह शीट, चेन बनाने के लिए है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
showColumns(columnIndex)
यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम को दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first column sheet.showColumns(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | वह कॉलम इंडेक्स जिसे दिखाना है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
showColumns(columnIndex, numColumns)
यह फ़ंक्शन, दिए गए इंडेक्स से शुरू होने वाले एक या उससे ज़्यादा लगातार कॉलम को दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first three columns sheet.showColumns(1, 3);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
column | Integer | सामने लाने के लिए कॉलम का शुरुआती इंडेक्स. |
num | Integer | अनहाइड किए जाने वाले कॉलम की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
showRows(rowIndex)
यह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद लाइन को दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first row sheet.showRows(1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | वह इंडेक्स जिसे दिखाना है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
showRows(rowIndex, numRows)
इस फ़ंक्शन का इस्तेमाल करके, दिए गए इंडेक्स से शुरू होने वाली एक या उससे ज़्यादा लगातार पंक्तियों को दिखाया जा सकता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first three rows sheet.showRows(1, 3);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | छुपाई गई लाइनों को दिखाने के लिए, शुरुआती इंडेक्स. |
num | Integer | छुपाई गई पंक्तियों की संख्या. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
showSheet()
इससे शीट दिखने लगती है. अगर शीट पहले से दिख रही है, तो इस विकल्प का कोई असर नहीं होता.
const sheet = SpreadsheetApp.getActiveSheet(); sheet.showSheet();
वापसी का टिकट
Sheet — मौजूदा शीट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
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
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
updateChart(chart)
इस शीट पर मौजूद चार्ट को अपडेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This code is going to loop through all the charts and change them to // column charts const charts = sheet.getCharts(); for (const i in charts) { const chart = charts[i]; const newChart = chart.modify().setChartType(Charts.ChartType.COLUMN).build(); sheet.updateChart(newChart); }
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
chart | Embedded | अपडेट किया जाने वाला चार्ट. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets