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