Class Spreadsheet

स्प्रेडशीट

Google Sheets की फ़ाइलों को ऐक्सेस और उनमें बदलाव करना. आम तौर पर किए जाने वाले कामों में, नई शीट जोड़ना और सहयोगी जोड़ना शामिल है.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
addDeveloperMetadata(key)Spreadsheetयह फ़ंक्शन, सबसे ऊपर के लेवल की स्प्रेडशीट में, तय की गई कुंजी के साथ डेवलपर मेटाडेटा जोड़ता है.
addDeveloperMetadata(key, visibility)Spreadsheetयह फ़ंक्शन, स्प्रेडशीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और दिखने की सेटिंग होती है.
addDeveloperMetadata(key, value)Spreadsheetयह फ़ंक्शन, स्प्रेडशीट में डेवलपर मेटाडेटा जोड़ता है. इसके लिए, तय की गई कुंजी और वैल्यू का इस्तेमाल किया जाता है.
addDeveloperMetadata(key, value, visibility)Spreadsheetयह फ़ंक्शन, स्प्रेडशीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी, वैल्यू, और दिखने की सेटिंग होती है.
addEditor(emailAddress)Spreadsheetइस विकल्प का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ा जाता है.
addEditor(user)Spreadsheetइस विकल्प का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ा जाता है.
addEditors(emailAddresses)Spreadsheetइस तरीके का इस्तेमाल करके, उपयोगकर्ताओं की दी गई सूची को Spreadsheet के लिए संपादकों की सूची में जोड़ा जाता है.
addMenu(name, subMenus)voidयह स्प्रेडशीट के यूज़र इंटरफ़ेस (यूआई) में एक नया मेन्यू बनाता है.
addViewer(emailAddress)Spreadsheetइस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है.
addViewer(user)Spreadsheetइस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है.
addViewers(emailAddresses)Spreadsheetइस तरीके का इस्तेमाल करके, उपयोगकर्ताओं की दी गई सूची को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है.
appendRow(rowContents)Sheetयह फ़ंक्शन, शीट में मौजूद मौजूदा डेटा क्षेत्र की सबसे नीचे वाली पंक्ति में एक नई पंक्ति जोड़ता है.
autoResizeColumn(columnPosition)Sheetयह विकल्प, दिए गए कॉलम की चौड़ाई को उसके कॉन्टेंट के हिसाब से सेट करता है.
copy(name)Spreadsheetयह फ़ंक्शन, स्प्रेडशीट की कॉपी बनाता है और नई स्प्रेडशीट दिखाता है.
createDeveloperMetadataFinder()DeveloperMetadataFinderयह स्प्रेडशीट के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए, DeveloperMetadataFinder दिखाता है.
createTextFinder(findText)TextFinderयह स्प्रेडशीट के लिए टेक्स्ट फ़ाइंडर बनाता है. इसका इस्तेमाल स्प्रेडशीट में टेक्स्ट ढूंढने और बदलने के लिए किया जा सकता है.
deleteActiveSheet()Sheetइससे मौजूदा शीट मिट जाती है.
deleteColumn(columnPosition)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन पर मौजूद कॉलम को मिटाता है.
deleteColumns(columnPosition, howMany)voidयह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले कॉलम की संख्या को मिटाता है.
deleteRow(rowPosition)Sheetलाइन की दी गई जगह पर मौजूद लाइन को मिटाता है.
deleteRows(rowPosition, howMany)voidइससे, दी गई लाइन की पोज़िशन से शुरू होने वाली लाइनों की संख्या मिट जाती है.
deleteSheet(sheet)voidइससे बताई गई शीट मिट जाती है.
duplicateActiveSheet()Sheetयह फ़ंक्शन, ऐक्टिव शीट की डुप्लीकेट कॉपी बनाता है और उसे ऐक्टिव शीट के तौर पर सेट करता है.
getActiveCell()Rangeइस शीट में मौजूद ऐक्टिव सेल की जानकारी दिखाता है.
getActiveRange()Rangeयह फ़ंक्शन, चालू शीट में चुनी गई रेंज दिखाता है. अगर कोई रेंज चालू नहीं है, तो यह null दिखाता है.
getActiveRangeList()RangeListयह फ़ंक्शन, ऐक्टिव शीट में मौजूद ऐक्टिव रेंज की सूची दिखाता है. अगर कोई ऐक्टिव रेंज मौजूद नहीं है, तो यह null दिखाता है.
getActiveSheet()Sheetयह फ़ंक्शन, स्प्रेडशीट में मौजूद ऐक्टिव शीट को दिखाता है.
getAs(contentType)Blobइस ऑब्जेक्ट में मौजूद डेटा को, बताए गए कॉन्टेंट टाइप में बदले गए ब्लॉब के तौर पर दिखाता है.
getBandings()Banding[]यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद सभी बैंडिंग दिखाता है.
getBlob()Blobइस ऑब्जेक्ट में मौजूद डेटा को blob के तौर पर दिखाओ.
getColumnWidth(columnPosition)Integerइस फ़ंक्शन से, दी गई कॉलम की चौड़ाई पिक्सल में मिलती है.
getCurrentCell()Rangeयह फ़ंक्शन, ऐक्टिव शीट में मौजूद मौजूदा सेल या null दिखाता है. अगर कोई मौजूदा सेल नहीं है, तो यह null दिखाता है.
getDataRange()Rangeयह फ़ंक्शन, उन डाइमेंशन के लिए Range दिखाता है जिनमें डेटा मौजूद है.
getDataSourceFormulas()DataSourceFormula[]इससे डेटा सोर्स के सभी फ़ॉर्मूले मिलते हैं.
getDataSourcePivotTables()DataSourcePivotTable[]इससे डेटा सोर्स की सभी पिवट टेबल मिलती हैं.
getDataSourceRefreshSchedules()DataSourceRefreshSchedule[]इस स्प्रेडशीट के रीफ़्रेश होने के शेड्यूल की जानकारी मिलती है.
getDataSourceSheets()DataSourceSheet[]यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स शीट दिखाता है.
getDataSourceTables()DataSourceTable[]इससे डेटा सोर्स की सभी टेबल मिलती हैं.
getDataSources()DataSource[]यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स दिखाता है.
getDeveloperMetadata()DeveloperMetadata[]टॉप-लेवल की स्प्रेडशीट से जुड़ा डेवलपर मेटाडेटा मिलता है.
getEditors()User[]इस Spreadsheet के लिए एडिटर की सूची मिलती है.
getFormUrl()Stringयह फ़ंक्शन, उस फ़ॉर्म का यूआरएल दिखाता है जिसके जवाब इस स्प्रेडशीट में भेजे जाते हैं. अगर इस स्प्रेडशीट से कोई फ़ॉर्म नहीं जुड़ा है, तो यह null दिखाता है.
getFrozenColumns()Integerफ़्रीज़ किए गए कॉलम की संख्या दिखाता है.
getFrozenRows()Integerइस फ़ंक्शन की मदद से, फ़्रीज़ की गई पंक्तियों की संख्या मिलती है.
getId()Stringइस स्प्रेडशीट के लिए यूनीक आइडेंटिफ़ायर मिलता है.
getImages()OverGridImage[]यह फ़ंक्शन, शीट पर मौजूद सभी ओवर-द-ग्रिड इमेज दिखाता है.
getIterativeCalculationConvergenceThreshold()Numberयह फ़ंक्शन, बार-बार की जाने वाली कैलकुलेशन के दौरान इस्तेमाल की गई थ्रेशोल्ड वैल्यू दिखाता है.
getLastColumn()Integerयह फ़ंक्शन, कॉन्टेंट वाले आखिरी कॉलम की पोज़िशन दिखाता है.
getLastRow()Integerकॉन्टेंट वाली आखिरी लाइन की पोज़िशन दिखाता है.
getMaxIterativeCalculationCycles()Integerयह फ़ंक्शन, इटरेटिव कैलकुलेशन के दौरान इस्तेमाल किए जाने वाले ज़्यादा से ज़्यादा इटरेशन की संख्या दिखाता है.
getName()Stringइससे दस्तावेज़ का नाम मिलता है.
getNamedRanges()NamedRange[]इस स्प्रेडशीट में मौजूद सभी नेम रेंज को दिखाता है.
getNumSheets()Integerयह फ़ंक्शन, इस स्प्रेडशीट में मौजूद शीट की संख्या दिखाता है.
getOwner()Userयह फ़ंक्शन, दस्तावेज़ के मालिक का नाम दिखाता है. अगर दस्तावेज़, शेयर की गई ड्राइव में है, तो यह null दिखाता है.
getPredefinedSpreadsheetThemes()SpreadsheetTheme[]पहले से तय की गई थीम की सूची दिखाता है.
getProtections(type)Protection[]यह स्प्रेडशीट में सुरक्षित की गई सभी रेंज या शीट को दिखाने वाले ऑब्जेक्ट की कैटगरी को दिखाता है.
getRange(a1Notation)Rangeयह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताई गई रेंज दिखाता है.
getRangeByName(name)Rangeयह फ़ंक्शन, किसी नाम वाली रेंज दिखाता है. अगर दिए गए नाम वाली कोई रेंज नहीं मिलती है, तो यह null दिखाता है.
getRangeList(a1Notations)RangeListयह फ़ंक्शन, उसी शीट में मौजूद उन रेंज का RangeList कलेक्शन दिखाता है जिन्हें A1 नोटेशन या R1C1 नोटेशन की ऐसी सूची से तय किया गया है जिसमें कोई वैल्यू मौजूद है.
getRecalculationInterval()RecalculationIntervalइस स्प्रेडशीट के लिए, कैलकुलेशन इंटरवल दिखाता है.
getRowHeight(rowPosition)Integerइस तरीके से, दी गई लाइन की ऊंचाई पिक्सल में मिलती है.
getSelection()Selectionयह फ़ंक्शन, स्प्रेडशीट में मौजूद मौजूदा Selection दिखाता है.
getSheetById(id)Sheetइस फ़ंक्शन से, दिए गए आईडी वाली शीट मिलती है.
getSheetByName(name)Sheetयह फ़ंक्शन, दिए गए नाम वाली शीट दिखाता है.
getSheetId()Integerयह फ़ंक्शन, इस ऑब्जेक्ट से जुड़ी शीट का आईडी दिखाता है.
getSheetName()Stringयह फ़ंक्शन, शीट का नाम दिखाता है.
getSheetValues(startRow, startColumn, numRows, numColumns)Object[][]यह फ़ंक्शन, दिए गए कोऑर्डिनेट से शुरू होने वाली इस रेंज के लिए, वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है.
getSheets()Sheet[]इस स्प्रेडशीट की सभी शीट मिलती हैं.
getSpreadsheetLocale()Stringस्प्रेडशीट का स्थान-भाषा सेट करता है.
getSpreadsheetTheme()SpreadsheetThemeयह फ़ंक्शन, स्प्रेडशीट की मौजूदा थीम दिखाता है. अगर कोई थीम लागू नहीं की गई है, तो यह null दिखाता है.
getSpreadsheetTimeZone()Stringस्प्रेडशीट के टाइम ज़ोन की जानकारी मिलती है.
getUrl()Stringयह फ़ंक्शन, दी गई स्प्रेडशीट के लिए यूआरएल दिखाता है.
getViewers()User[]इस Spreadsheet के लिए, दर्शकों और टिप्पणी करने वालों की सूची मिलती है.
hideColumn(column)voidयह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को छिपाता है.
hideRow(row)voidयह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों को छिपाता है.
insertColumnAfter(afterPosition)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद एक कॉलम जोड़ता है.
insertColumnBefore(beforePosition)Sheetयह फ़ंक्शन, दी गई कॉलम की पोज़िशन से पहले एक कॉलम जोड़ता है.
insertColumnsAfter(afterPosition, howMany)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद, तय किए गए कॉलम की संख्या को जोड़ता है.
insertColumnsBefore(beforePosition, howMany)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन से पहले कई कॉलम जोड़ता है.
insertDataSourceSheet(spec)DataSourceSheetयह स्प्रेडशीट में एक नया DataSourceSheet जोड़ता है और डेटा को प्रोसेस करना शुरू करता है.
insertImage(blobSource, column, row)OverGridImageयह फ़ंक्शन, किसी दस्तावेज़ में दी गई पंक्ति और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है.
insertImage(blobSource, column, row, offsetX, offsetY)OverGridImageयह फ़ंक्शन, किसी दस्तावेज़ में दी गई लाइन और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है. साथ ही, पिक्सल ऑफ़सेट भी तय करता है.
insertImage(url, column, row)OverGridImageदस्तावेज़ में किसी दी गई पंक्ति और कॉलम में इमेज डालता है.
insertImage(url, column, row, offsetX, offsetY)OverGridImageयह फ़ंक्शन, दस्तावेज़ में किसी इमेज को तय की गई लाइन और कॉलम में पिक्सल ऑफ़सेट के साथ जोड़ता है.
insertRowAfter(afterPosition)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद एक पंक्ति जोड़ता है.
insertRowBefore(beforePosition)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले एक पंक्ति जोड़ता है.
insertRowsAfter(afterPosition, howMany)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद कई पंक्तियां जोड़ता है.
insertRowsBefore(beforePosition, howMany)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले कई पंक्तियां जोड़ता है.
insertSheet()Sheetयह फ़ंक्शन, स्प्रेडशीट में डिफ़ॉल्ट नाम वाली नई शीट जोड़ता है.
insertSheet(sheetIndex)Sheetयह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर एक नई शीट जोड़ता है.
insertSheet(sheetIndex, options)Sheetयह फ़ंक्शन, दी गई इंडेक्स वैल्यू के हिसाब से स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, इसमें वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है.
insertSheet(options)Sheetयह फ़ंक्शन, स्प्रेडशीट में नई शीट जोड़ता है. इसके लिए, शीट के डिफ़ॉल्ट नाम और वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जाता है.
insertSheet(sheetName)Sheetयह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है.
insertSheet(sheetName, sheetIndex)Sheetयह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर, दिए गए नाम की नई शीट जोड़ता है.
insertSheet(sheetName, sheetIndex, options)Sheetयह फ़ंक्शन, स्प्रैडशीट में दी गई इंडेक्स वैल्यू पर दिए गए नाम की नई शीट जोड़ता है. साथ ही, यह ज़रूरत के हिसाब से ऐडवांस आर्ग्युमेंट का इस्तेमाल करता है.
insertSheet(sheetName, options)Sheetयह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है. साथ ही, इसमें ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है.
insertSheetWithDataSourceTable(spec)Sheetयह स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, दिए गए डेटा सोर्स स्पेसिफ़िकेशन के साथ पूरी शीट में फ़ैला हुआ DataSourceTable बनाता है और डेटा को प्रोसेस करना शुरू करता है.
isColumnHiddenByUser(columnPosition)Booleanयह फ़ंक्शन बताता है कि उपयोगकर्ता ने दी गई कॉलम को छिपाया है या नहीं.
isIterativeCalculationEnabled()Booleanयह फ़ंक्शन बताता है कि इस स्प्रेडशीट में इटरेटिव कैलकुलेशन की सुविधा चालू है या नहीं.
isRowHiddenByFilter(rowPosition)Booleanयह फ़ंक्शन बताता है कि दी गई लाइन को फ़िल्टर (फ़िल्टर व्यू नहीं) की मदद से छिपाया गया है या नहीं.
isRowHiddenByUser(rowPosition)Booleanइससे यह पता चलता है कि दी गई लाइन को उपयोगकर्ता ने छिपाया है या नहीं.
moveActiveSheet(pos)voidइस फ़ंक्शन की मदद से, चालू शीट को शीट की सूची में दी गई जगह पर ले जाया जाता है.
moveChartToObjectSheet(chart)Sheetयह फ़ंक्शन, नई SheetType.OBJECT शीट बनाता है और दिए गए चार्ट को उसमें ले जाता है.
refreshAllDataSources()voidयह सुविधा, काम करने वाले सभी डेटा सोर्स और उनसे लिंक किए गए डेटा सोर्स ऑब्जेक्ट को रीफ़्रेश करती है. साथ ही, अमान्य डेटा सोर्स ऑब्जेक्ट को छोड़ देती है.
removeEditor(emailAddress)Spreadsheetइस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के संपादकों की सूची से हटा दिया जाता है.
removeEditor(user)Spreadsheetइस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के संपादकों की सूची से हटा दिया जाता है.
removeMenu(name)voidaddMenu(name, subMenus) ने जो मेन्यू जोड़ा था उसे हटाता है.
removeNamedRange(name)voidइस फ़ंक्शन का इस्तेमाल करके, दिए गए नाम वाली रेंज को मिटाया जा सकता है.
removeViewer(emailAddress)Spreadsheetयह दिए गए उपयोगकर्ता को Spreadsheet के लिए, दर्शकों और टिप्पणीकारों की सूची से हटाता है.
removeViewer(user)Spreadsheetयह दिए गए उपयोगकर्ता को Spreadsheet के लिए, दर्शकों और टिप्पणीकारों की सूची से हटाता है.
rename(newName)voidदस्तावेज़ का नाम बदलता है.
renameActiveSheet(newName)voidइस फ़ंक्शन की मदद से, मौजूदा चालू शीट का नाम बदलकर नया नाम रखा जा सकता है.
resetSpreadsheetTheme()SpreadsheetThemeयह फ़ंक्शन, स्प्रेडशीट पर लागू की गई थीम को हटाता है और डिफ़ॉल्ट थीम सेट करता है.
setActiveRange(range)Rangeयह फ़ंक्शन, चुनी गई रेंज को चालू शीट में active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर मौजूद बाएं सेल को current cell के तौर पर सेट करता है.
setActiveRangeList(rangeList)RangeListयह फ़ंक्शन, रेंज की दी गई सूची को ऐक्टिव शीट में active ranges के तौर पर सेट करता है.
setActiveSelection(range)Rangeइस शीट के लिए, चुने गए सेल की रेंज सेट करता है.
setActiveSelection(a1Notation)Rangeयह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताए गए हिसाब से, ऐक्टिव सेल को सेट करता है.
setActiveSheet(sheet)Sheetयह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है.
setActiveSheet(sheet, restoreSelection)Sheetयह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है. साथ ही, उस शीट में सबसे हाल ही में किए गए बदलाव को वापस लाने का विकल्प देता है.
setColumnWidth(columnPosition, width)Sheetइससे दिए गए कॉलम की चौड़ाई पिक्सल में सेट की जाती है.
setCurrentCell(cell)Rangeइस फ़ंक्शन से, तय की गई सेल को current cell के तौर पर सेट किया जाता है.
setFrozenColumns(columns)voidइससे, दी गई संख्या के हिसाब से कॉलम फ़्रीज़ हो जाते हैं.
setFrozenRows(rows)voidदी गई पंक्तियों की संख्या को फ़्रीज़ करता है.
setIterativeCalculationConvergenceThreshold(minThreshold)Spreadsheetयह विकल्प, बार-बार होने वाली कैलकुलेशन के लिए कम से कम थ्रेशोल्ड वैल्यू सेट करता है.
setIterativeCalculationEnabled(isEnabled)Spreadsheetइस स्प्रेडशीट में इटरेटिव कैलकुलेशन की सुविधा चालू है या नहीं, यह सेट करता है.
setMaxIterativeCalculationCycles(maxIterations)Spreadsheetइससे कैलकुलेशन के दोहराव की ज़्यादा से ज़्यादा संख्या सेट की जाती है. यह संख्या, कैलकुलेशन के दोहराव के दौरान इस्तेमाल की जाती है.
setNamedRange(name, range)voidकिसी रेंज को नाम देता है.
setRecalculationInterval(recalculationInterval)Spreadsheetइससे यह तय होता है कि इस स्प्रेडशीट को कितनी बार फिर से कैलकुलेट करना चाहिए.
setRowHeight(rowPosition, height)Sheetयह विकल्प, दी गई लाइन की ऊंचाई को पिक्सल में सेट करता है.
setSpreadsheetLocale(locale)voidस्प्रेडशीट की भाषा सेट करता है.
setSpreadsheetTheme(theme)SpreadsheetThemeइस कुकी का इस्तेमाल स्प्रेडशीट पर थीम सेट करने के लिए किया जाता है.
setSpreadsheetTimeZone(timezone)voidयह विकल्प, स्प्रेडशीट के लिए टाइम ज़ोन सेट करता है.
show(userInterface)voidयह फ़ंक्शन, उपयोगकर्ता के ब्राउज़र के व्यूपोर्ट के बीच में मौजूद डायलॉग में, कस्टम यूज़र इंटरफ़ेस कॉम्पोनेंट दिखाता है.
sort(columnPosition)Sheetयह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से बढ़ते क्रम में लगाता है.
sort(columnPosition, ascending)Sheetयह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से क्रम में लगाता है.
toast(msg)voidयह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में, दिए गए मैसेज के साथ एक पॉप-अप विंडो दिखाता है.
toast(msg, title)voidयह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में एक पॉप-अप विंडो दिखाता है. इसमें दिया गया मैसेज और टाइटल दिखता है.
toast(msg, title, timeoutSeconds)voidयह फ़ंक्शन, स्प्रेडशीट के सबसे नीचे दाएं कोने में एक पॉप-अप विंडो दिखाता है. इसमें दिया गया टाइटल और मैसेज होता है. यह विंडो, कुछ समय तक दिखती रहती है.
unhideColumn(column)voidयह फ़ंक्शन, दी गई रेंज में कॉलम को दिखाता है.
unhideRow(row)voidयह फ़ंक्शन, दी गई रेंज में मौजूद पंक्ति को दिखाता है.
updateMenu(name, subMenus)voidaddMenu(name, subMenus) से जोड़े गए मेन्यू को अपडेट करता है.
waitForAllDataExecutionsCompletion(timeoutInSeconds)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());

पैरामीटर

नामटाइपब्यौरा
keyStringनए डेवलपर मेटाडेटा के लिए कुंजी.

वापसी का टिकट

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()}`);

पैरामीटर

नामटाइपब्यौरा
keyStringनए डेवलपर मेटाडेटा के लिए कुंजी.
visibilityDeveloperMetadataVisibilityनए डेवलपर मेटाडेटा के दिखने की स्थिति.

वापसी का टिकट

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()}`,
);

पैरामीटर

नामटाइपब्यौरा
keyStringनए डेवलपर मेटाडेटा के लिए कुंजी.
valueStringनए डेवलपर मेटाडेटा की वैल्यू.

वापसी का टिकट

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()}`);

पैरामीटर

नामटाइपब्यौरा
keyStringनए डेवलपर मेटाडेटा के लिए कुंजी.
valueStringनए डेवलपर मेटाडेटा की वैल्यू.
visibilityDeveloperMetadataVisibilityनए डेवलपर मेटाडेटा के दिखने की स्थिति.

वापसी का टिकट

Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

addEditor(emailAddress)

इस विकल्प का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही दर्शकों की सूची में शामिल था, तो यह तरीका उपयोगकर्ता को दर्शकों की सूची से बाहर कर देता है.

पैरामीटर

नामटाइपब्यौरा
emailAddressStringजिस उपयोगकर्ता को जोड़ना है उसका ईमेल पता.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

addEditor(user)

इस विकल्प का इस्तेमाल करके, दिए गए उपयोगकर्ता को Spreadsheet के लिए संपादकों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही दर्शकों की सूची में शामिल था, तो यह तरीका उपयोगकर्ता को दर्शकों की सूची से बाहर कर देता है.

पैरामीटर

नामटाइपब्यौरा
userUserजोड़े जाने वाले उपयोगकर्ता का प्रतिनिधित्व.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

addEditors(emailAddresses)

इस तरीके का इस्तेमाल करके, उपयोगकर्ताओं की दी गई सूची को Spreadsheet के लिए संपादकों की सूची में जोड़ा जाता है. अगर कोई उपयोगकर्ता पहले से ही दर्शकों की सूची में शामिल है, तो इस तरीके से उसे दर्शकों की सूची से हटा दिया जाता है.

पैरामीटर

नामटाइपब्यौरा
emailAddressesString[]जोड़े जाने वाले उपयोगकर्ताओं के ईमेल पतों की एक कैटगरी.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

addMenu(name, subMenus)

यह स्प्रेडशीट के यूज़र इंटरफ़ेस (यूआई) में एक नया मेन्यू बनाता है.

हर मेन्यू एंट्री, उपयोगकर्ता के तय किए गए फ़ंक्शन को चलाती है. आम तौर पर, इसे onOpen() फ़ंक्शन से कॉल किया जाता है, ताकि स्प्रेडशीट लोड होने पर मेन्यू अपने-आप बन जाए.

// The onOpen function is executed automatically every time a Spreadsheet is
// loaded
function onOpen() {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const menuEntries = [];
  // When the user clicks on "addMenuExample" then "Menu Entry 1", the function
  // function1 is executed.
  menuEntries.push({name: 'Menu Entry 1', functionName: 'function1'});
  menuEntries.push(null);  // line separator
  menuEntries.push({name: 'Menu Entry 2', functionName: 'function2'});

  ss.addMenu('addMenuExample', menuEntries);
}

पैरामीटर

नामटाइपब्यौरा
nameStringबनाए जाने वाले मेन्यू का नाम.
subMenusObject[]name और functionName पैरामीटर वाले JavaScript मैप का कलेक्शन. शामिल की गई लाइब्रेरी के फ़ंक्शन इस्तेमाल किए जा सकते हैं. जैसे, Library.libFunction1.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

addViewer(emailAddress)

इस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही संपादकों की सूची में शामिल है, तो इस तरीके का कोई असर नहीं होगा.

पैरामीटर

नामटाइपब्यौरा
emailAddressStringजिस उपयोगकर्ता को जोड़ना है उसका ईमेल पता.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

addViewer(user)

इस फ़ंक्शन की मदद से, दिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है. अगर उपयोगकर्ता पहले से ही संपादकों की सूची में शामिल है, तो इस तरीके का कोई असर नहीं होगा.

पैरामीटर

नामटाइपब्यौरा
userUserजोड़े जाने वाले उपयोगकर्ता का प्रतिनिधित्व.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

addViewers(emailAddresses)

इस तरीके का इस्तेमाल करके, उपयोगकर्ताओं की दी गई सूची को Spreadsheet के दर्शकों की सूची में जोड़ा जाता है. अगर कोई उपयोगकर्ता पहले से ही संपादकों की सूची में शामिल है, तो इस तरीके का उस पर कोई असर नहीं पड़ेगा.

पैरामीटर

नामटाइपब्यौरा
emailAddressesString[]जोड़े जाने वाले उपयोगकर्ताओं के ईमेल पतों की एक कैटगरी.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

appendRow(rowContents)

यह फ़ंक्शन, शीट में मौजूद मौजूदा डेटा क्षेत्र की सबसे नीचे वाली पंक्ति में एक नई पंक्ति जोड़ता है. अगर किसी सेल का कॉन्टेंट = से शुरू होता है, तो उसे फ़ॉर्मूला माना जाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Appends a new row with 3 columns to the bottom of the current
// data region in the sheet containing the values in the array.
sheet.appendRow(['a man', 'a plan', 'panama']);

पैरामीटर

नामटाइपब्यौरा
rowContentsObject[]शीट की आखिरी लाइन के बाद डाली जाने वाली वैल्यू का ऐरे.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

autoResizeColumn(columnPosition)

यह विकल्प, दिए गए कॉलम की चौड़ाई को उसके कॉन्टेंट के हिसाब से सेट करता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

sheet.getRange('a1').setValue(
    'Whenever it is a damp, drizzly November in my soul...');

// Sets the first column to a width which fits the text
sheet.autoResizeColumn(1);

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerजिस कॉलम का साइज़ बदलना है उसकी पोज़िशन.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

copy(name)

यह फ़ंक्शन, स्प्रेडशीट की कॉपी बनाता है और नई स्प्रेडशीट दिखाता है.

// This code makes a copy of the current spreadsheet and names it appropriately
const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.copy(`Copy of ${ss.getName()}`);

पैरामीटर

नामटाइपब्यौरा
nameStringकॉपी का नाम.

वापसी का टिकट

Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

createDeveloperMetadataFinder()

यह स्प्रेडशीट के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए, DeveloperMetadataFinder दिखाता है. डिफ़ॉल्ट रूप से, यह स्प्रेडशीट, शीट, लाइनों, और कॉलम से जुड़े सभी मेटाडेटा को ध्यान में रखता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet()
// instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Adds developer metadata to the spreadsheet.
ss.addDeveloperMetadata('NAME', 'CHARLIE');
ss.addDeveloperMetadata('COMPANY', 'EXAMPLE ORGANIZATION');
ss.addDeveloperMetadata('TECHNOLOGY', 'JAVASCRIPT');

// Creates a developer metadata finder.
const developerMetadataFinder = ss.createDeveloperMetadataFinder();

// Finds the developer metadata objects with 'COMPANY' as the key.
const googleMetadataFromSpreadsheet =
    developerMetadataFinder.withKey('COMPANY').find();

// Gets the first result of developer metadata that has the key 'COMPANY' and
// logs its value.
console.log(googleMetadataFromSpreadsheet[0].getValue());

वापसी का टिकट

DeveloperMetadataFinder — यह डेवलपर मेटाडेटा ढूंढने वाला टूल है. इसकी मदद से, इस स्प्रेडशीट के दायरे में मेटाडेटा खोजा जा सकता है.


createTextFinder(findText)

यह स्प्रेडशीट के लिए टेक्स्ट फ़ाइंडर बनाता है. इसका इस्तेमाल स्प्रेडशीट में टेक्स्ट ढूंढने और बदलने के लिए किया जा सकता है. खोज, स्प्रेडशीट की पहली शीट से शुरू होती है.

const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();

// Creates  a text finder.
const textFinder = spreadsheet.createTextFinder('dog');

// Returns the first occurrence of 'dog' in the spreadsheet.
const firstOccurrence = textFinder.findNext();

// Replaces the last found occurrence of 'dog' with 'cat' and returns the number
// of occurrences replaced.
const numOccurrencesReplaced = textFinder.replaceWith('cat');

पैरामीटर

नामटाइपब्यौरा
findTextStringवह टेक्स्ट जिसे खोजना है.

वापसी का टिकट

TextFinder — स्प्रेडशीट के लिए TextFinder.


deleteActiveSheet()

इससे मौजूदा शीट मिट जाती है.

// The code below deletes the currently active sheet and stores the new active
// sheet in a variable
const newSheet = SpreadsheetApp.getActiveSpreadsheet().deleteActiveSheet();

वापसी का टिकट

Sheet — यह नई ऐक्टिव शीट है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

deleteColumn(columnPosition)

यह फ़ंक्शन, कॉलम की दी गई पोज़िशन पर मौजूद कॉलम को मिटाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];
// Columns start at "1" - this deletes the first column
sheet.deleteColumn(1);

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerकॉलम की पोज़िशन. पहले कॉलम के लिए, इसकी वैल्यू 1 से शुरू होती है.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

deleteColumns(columnPosition, howMany)

यह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले कॉलम की संख्या को मिटाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];
// Columns start at "1" - this deletes the first two columns
sheet.deleteColumns(1, 2);

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerमिटाए जाने वाले पहले कॉलम की पोज़िशन.
howManyIntegerमिटाए जाने वाले कॉलम की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

deleteRow(rowPosition)

लाइन की दी गई जगह पर मौजूद लाइन को मिटाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];
// Rows start at "1" - this deletes the first row
sheet.deleteRow(1);

पैरामीटर

नामटाइपब्यौरा
rowPositionIntegerलाइन की पोज़िशन. पहली लाइन के लिए, इसकी वैल्यू 1 से शुरू होती है.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

deleteRows(rowPosition, howMany)

इससे, दी गई लाइन की पोज़िशन से शुरू होने वाली लाइनों की संख्या मिट जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];
// Rows start at "1" - this deletes the first two rows
sheet.deleteRows(1, 2);

पैरामीटर

नामटाइपब्यौरा
rowPositionIntegerमिटाई जाने वाली पहली लाइन की पोज़िशन.
howManyIntegerमिटाई जाने वाली लाइनों की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

deleteSheet(sheet)

इससे बताई गई शीट मिट जाती है.

// The code below deletes the specified sheet.
const ss = SpreadsheetApp.getActive();
const sheet = ss.getSheetByName('My Sheet');
ss.deleteSheet(sheet);

पैरामीटर

नामटाइपब्यौरा
sheetSheetवह शीट जिसे मिटाना है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

duplicateActiveSheet()

यह फ़ंक्शन, ऐक्टिव शीट की डुप्लीकेट कॉपी बनाता है और उसे ऐक्टिव शीट के तौर पर सेट करता है.

// The code below makes a duplicate of the active sheet
SpreadsheetApp.getActiveSpreadsheet().duplicateActiveSheet();

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getActiveCell()

इस शीट में मौजूद ऐक्टिव सेल की जानकारी दिखाता है.

ध्यान दें: हमारा सुझाव है कि आप getCurrentCell() का इस्तेमाल करें. इससे हाइलाइट की गई मौजूदा सेल की वैल्यू मिलती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];
// Returns the active cell
const cell = sheet.getActiveCell();

वापसी का टिकट

Range — यह मौजूदा ऐक्टिव सेल है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getActiveRange()

यह फ़ंक्शन, चालू शीट में चुनी गई रेंज दिखाता है. अगर कोई रेंज चालू नहीं है, तो यह null दिखाता है. अगर एक से ज़्यादा रेंज चुनी जाती हैं, तो यह तरीका सिर्फ़ आखिरी चुनी गई रेंज दिखाता है.

"ऐक्टिव रेंज" का मतलब उस रेंज से है जिसे उपयोगकर्ता ने ऐक्टिव शीट में चुना है. हालांकि, कस्टम फ़ंक्शन में इसका मतलब उस सेल से है जिसकी वैल्यू को फिर से कैलकुलेट किया जा रहा है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const activeRange = sheet.getActiveRange();

वापसी का टिकट

Range — ऐक्टिव रेंज.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

इन्हें भी देखें


getActiveRangeList()

यह फ़ंक्शन, ऐक्टिव शीट में मौजूद ऐक्टिव रेंज की सूची दिखाता है. अगर कोई ऐक्टिव रेंज मौजूद नहीं है, तो यह null दिखाता है.

अगर सिर्फ़ एक रेंज चुनी गई है, तो यह getActiveRange() कॉल की तरह काम करता है.

const sheet = SpreadsheetApp.getActiveSheet();
// Returns the list of active ranges.
const activeRangeList = sheet.getActiveRangeList();

वापसी का टिकट

RangeList — ऐक्टिव रेंज की सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

इन्हें भी देखें


getActiveSheet()

यह फ़ंक्शन, स्प्रेडशीट में मौजूद ऐक्टिव शीट को दिखाता है.

स्प्रेडशीट में ऐक्टिव शीट वह शीट होती है जो स्प्रेडशीट के यूज़र इंटरफ़ेस (यूआई) में दिख रही होती है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();

वापसी का टिकट

Sheet — स्प्रेडशीट में मौजूद ऐक्टिव शीट.


getAs(contentType)

इस ऑब्जेक्ट में मौजूद डेटा को, बताए गए कॉन्टेंट टाइप में बदले गए ब्लॉब के तौर पर दिखाता है. इस तरीके से, फ़ाइल के नाम में सही एक्सटेंशन जुड़ जाता है. उदाहरण के लिए, "myfile.pdf". हालांकि, यह मानता है कि फ़ाइल के नाम का वह हिस्सा जो आखिरी अवधि के बाद आता है (अगर कोई हो), एक मौजूदा एक्सटेंशन है जिसे बदला जाना चाहिए. इसलिए, "ShoppingList.12.25.2014" बदलकर "ShoppingList.12.25.pdf" हो जाता है.

कन्वर्ज़न के लिए रोज़ के कोटे देखने के लिए, Google की सेवाओं के लिए कोटे देखें. नए Google Workspace डोमेन पर, कुछ समय के लिए ज़्यादा पाबंदियां लागू हो सकती हैं.

पैरामीटर

नामटाइपब्यौरा
contentTypeStringजिस MIME टाइप में बदलना है. ज़्यादातर ब्लॉब के लिए, 'application/pdf' ही मान्य विकल्प है. BMP, GIF, JPEG या PNG फ़ॉर्मैट में मौजूद इमेज के लिए, 'image/bmp', 'image/gif', 'image/jpeg' या 'image/png' में से कोई भी मान्य है. Google Docs दस्तावेज़ के लिए, 'text/markdown' भी मान्य है.

वापसी का टिकट

Blob — डेटा को एक बड़े बाइनरी ऑब्जेक्ट के तौर पर दिखाया जाता है.


getBandings()

यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद सभी बैंडिंग दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Gets an array of the bandings in the spreadsheet.
const bandings = ss.getBandings();

// Logs the range of the first banding in the spreadsheet to the console.
console.log(bandings[0].getRange().getA1Notation());

वापसी का टिकट

Banding[] — इस स्प्रेडशीट में मौजूद बैंडिंग.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getBlob()

इस ऑब्जेक्ट में मौजूद डेटा को blob के तौर पर दिखाओ.

वापसी का टिकट

Blob — डेटा को एक बड़े बाइनरी ऑब्जेक्ट के तौर पर दिखाया जाता है.


getColumnWidth(columnPosition)

इस फ़ंक्शन से, दी गई कॉलम की चौड़ाई पिक्सल में मिलती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Columns start at 1
Logger.log(sheet.getColumnWidth(1));

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerजांच किए जाने वाले कॉलम की पोज़िशन.

वापसी का टिकट

Integer — पिक्सल में कॉलम की चौड़ाई.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getCurrentCell()

यह फ़ंक्शन, ऐक्टिव शीट में मौजूद मौजूदा सेल या null दिखाता है. अगर कोई मौजूदा सेल नहीं है, तो यह null दिखाता है. मौजूदा सेल वह सेल होती है जिस पर Google Sheets के यूज़र इंटरफ़ेस (यूआई) में फ़ोकस किया जाता है. इसे गहरे रंग के बॉर्डर से हाइलाइट किया जाता है. एक समय में एक से ज़्यादा मौजूदा सेल नहीं होती. जब कोई उपयोगकर्ता एक या उससे ज़्यादा सेल रेंज चुनता है, तो चुनी गई सेल में से कोई एक सेल, मौजूदा सेल होती है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// Returns the current highlighted cell in the one of the active ranges.
const currentCell = sheet.getCurrentCell();

वापसी का टिकट

Range — मौजूदा सेल.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataRange()

यह फ़ंक्शन, उन डाइमेंशन के लिए Range दिखाता है जिनमें डेटा मौजूद है.

यह फ़ंक्शन, A1 और (Sheet.getLastColumn(), Sheet.getLastRow()) से बंधी हुई रेंज बनाने जैसा है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This represents ALL the data
const range = sheet.getDataRange();
const values = range.getValues();

// This logs the spreadsheet in CSV format with a trailing comma
for (let i = 0; i < values.length; i++) {
  let row = '';
  for (let j = 0; j < values[i].length; j++) {
    if (values[i][j]) {
      row = row + values[i][j];
    }
    row = `${row},`;
  }
  Logger.log(row);
}

वापसी का टिकट

Range — यह स्प्रेडशीट में मौजूद पूरे डेटा की रेंज होती है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSourceFormulas()

इससे डेटा सोर्स के सभी फ़ॉर्मूले मिलते हैं.

// Opens the spreadsheet by its ID. If you created your script from within a
// Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet().
// TODO(developer): Replace the ID with your own.
const ss = SpreadsheetApp.openById('abc123456');

// Gets Sheet1 by its name.
const sheet = ss.getSheetByName('Sheet1');

// Gets an array of the data source formulas on Sheet1.
// To get an array of data source formulas for the entire spreadsheet,
// replace 'sheet' with 'ss'.
const dataSourceFormulas = sheet.getDataSourceFormulas();

// Logs the first data source formula in the array.
console.log(dataSourceFormulas[0].getFormula());

वापसी का टिकट

DataSourceFormula[] — डेटा सोर्स के फ़ॉर्मूलों की सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSourcePivotTables()

इससे डेटा सोर्स की सभी पिवट टेबल मिलती हैं.

// Opens the spreadsheet file by its ID. If you created your script from a
// Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet().
// TODO(developer): Replace the ID with your own.
const ss = SpreadsheetApp.openById('abc123456');

// Gets Sheet1 by its name.
const sheet = ss.getSheetByName('Sheet1');

// Gets an array of the data source pivot tables on Sheet1.
// To get an array of data source pivot tables for the entire
// spreadsheet, replace 'sheet' with 'ss'.
const dataSourcePivotTables = sheet.getDataSourcePivotTables();

// Logs the last time that the first pivot table in the array was refreshed.
console.log(dataSourcePivotTables[0].getStatus().getLastRefreshedTime());

वापसी का टिकट

DataSourcePivotTable[] — डेटा सोर्स की पिवट टेबल की सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSourceRefreshSchedules()

इस स्प्रेडशीट के रीफ़्रेश होने के शेड्यूल की जानकारी मिलती है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet()
// instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Activates BigQuery operations for the connected spreadsheet.
SpreadsheetApp.enableBigQueryExecution();

// Gets the frequency type of the first referesh schedule in the array.
const frequencyType = ss.getDataSourceRefreshSchedules()[0]
                          .getFrequency()
                          .getFrequencyType()
                          .toString();

// Logs the frequency type to the console.
console.log(frequencyType);

वापसी का टिकट

DataSourceRefreshSchedule[] — इस स्प्रेडशीट के रीफ़्रेश होने के शेड्यूल.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSourceSheets()

यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स शीट दिखाता है.

// Turns data execution on for BigQuery data sources.
SpreadsheetApp.enableBigQueryExecution();

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Gets the first data source sheet in the spreadsheet.
const dataSource = ss.getDataSourceSheets()[0];

// Gets the name of the data source sheet.
console.log(dataSource.asSheet().getName());

वापसी का टिकट

DataSourceSheet[] — सभी डेटा सोर्स शीट की एक ऐरे.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSourceTables()

इससे डेटा सोर्स की सभी टेबल मिलती हैं.

// Opens the spreadsheet file by its ID. If you created your script from a
// Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet().
// TODO(developer): Replace the ID with your own.
const ss = SpreadsheetApp.openById('abc123456');

// Gets Sheet1 by its name.
const sheet = ss.getSheetByName('Sheet1');

// Gets an array of data source tables on Sheet1.
// To get an array of data source tables for the entire spreadsheet,
// replace 'sheet' with 'ss'.
const dataSourceTables = sheet.getDataSourceTables();

// Logs the last completed data execution time on the first data source table.
console.log(dataSourceTables[0].getStatus().getLastExecutionTime());

वापसी का टिकट

DataSourceTable[] — डेटा सोर्स टेबल की सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSources()

यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी डेटा सोर्स दिखाता है.

// Turns data execution on for BigQuery data sources.
SpreadsheetApp.enableBigQueryExecution();

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Gets the data sources on the spreadsheet.
const dataSources = ss.getDataSources();

// Logs the name of the first column on the first data source.
console.log(dataSources[0].getColumns()[0].getName());

वापसी का टिकट

DataSource[] — सभी डेटा सोर्स की एक ऐरे.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDeveloperMetadata()

टॉप-लेवल की स्प्रेडशीट से जुड़ा डेवलपर मेटाडेटा मिलता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Adds 'Google' as a key to the spreadsheet metadata.
ss.addDeveloperMetadata('Google');

// Gets the spreadsheet's metadata.
const ssMetadata = ss.getDeveloperMetadata();

// Gets the first set of the spreadsheet's metadata and logs the key to the
// console.
console.log(ssMetadata[0].getKey());

वापसी का टिकट

DeveloperMetadata[] — इस रेंज से जुड़ा डेवलपर मेटाडेटा.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getEditors()

इस Spreadsheet के लिए एडिटर की सूची मिलती है.

वापसी का टिकट

User[] — बदलाव करने की अनुमति वाले उपयोगकर्ताओं की एक सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getFormUrl()

यह फ़ंक्शन, उस फ़ॉर्म का यूआरएल दिखाता है जिसके जवाब इस स्प्रेडशीट में भेजे जाते हैं. अगर इस स्प्रेडशीट से कोई फ़ॉर्म नहीं जुड़ा है, तो यह null दिखाता है. अगर कई फ़ॉर्म इस स्प्रेडशीट में जवाब भेजते हैं, तो फ़ॉर्म का यूआरएल तय नहीं किया जा सकता. इसके अलावा, हर शीट के लिए फ़ॉर्म यूआरएल के असोसिएशन, Sheet.getFormUrl() तरीके से वापस पाए जा सकते हैं. अगर उपयोगकर्ता के पास स्प्रेडशीट में बदलाव करने की अनुमति नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Gets the form URL from the spreadsheet.
const formUrl = ss.getFormUrl();

// Logs the form URL to the console.
console.log(formUrl);

वापसी का टिकट

String — यह उस फ़ॉर्म का यूआरएल है जिसके जवाब इस स्प्रेडशीट में सेव किए जाते हैं. अगर इस स्प्रेडशीट से कोई फ़ॉर्म नहीं जुड़ा है, तो null डालें.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getFrozenColumns()

फ़्रीज़ किए गए कॉलम की संख्या दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

Logger.log('Number of frozen columns: %s', sheet.getFrozenColumns());

वापसी का टिकट

Integer — फ़्रीज़ किए गए कॉलम की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getFrozenRows()

इस फ़ंक्शन की मदद से, फ़्रीज़ की गई पंक्तियों की संख्या मिलती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

Logger.log('Number of frozen rows: %s', sheet.getFrozenRows());

वापसी का टिकट

Integer — फ़्रीज़ की गई लाइनों की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getId()

इस स्प्रेडशीट के लिए यूनीक आइडेंटिफ़ायर मिलता है. स्प्रेडशीट आईडी को उसके यूआरएल से निकाला जा सकता है. उदाहरण के लिए, यूआरएल https://docs.google.com/spreadsheets/d/abc1234567/edit#gid=0 में स्प्रेडशीट आईडी "abc1234567" है.

// The code below logs the ID for the active spreadsheet.
Logger.log(SpreadsheetApp.getActiveSpreadsheet().getId());

वापसी का टिकट

String — स्प्रेडशीट के लिए यूनीक आईडी (या कुंजी).


getImages()

यह फ़ंक्शन, शीट पर मौजूद सभी ओवर-द-ग्रिड इमेज दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Gets Sheet1 by its name.
const sheet = ss.getSheetByName('Sheet1');

// Gets the over-the-grid images from Sheet1.
// To get the over-the-grid images from the entire spreadsheet, use
// ss.getImages() instead.
const images = sheet.getImages();

// For each image, logs the anchor cell in A1 notation.
for (const image of images) {
  console.log(image.getAnchorCell().getA1Notation());
}

वापसी का टिकट

OverGridImage[] — ओवर-द-ग्रिड इमेज का कलेक्शन.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getIterativeCalculationConvergenceThreshold()

यह फ़ंक्शन, बार-बार की जाने वाली कैलकुलेशन के दौरान इस्तेमाल की गई थ्रेशोल्ड वैल्यू दिखाता है. जब लगातार की गई कैलकुलेशन के नतीजे इस वैल्यू से कम होते हैं, तो बार-बार की जाने वाली कैलकुलेशन बंद हो जाती है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Sets the iterative calculation convergence threshold for the spreadsheet.
ss.setIterativeCalculationConvergenceThreshold(2);

// Logs the threshold to the console.
console.log(ss.getIterativeCalculationConvergenceThreshold());

वापसी का टिकट

Number — कन्वर्जेंस थ्रेशोल्ड.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getLastColumn()

यह फ़ंक्शन, कॉन्टेंट वाले आखिरी कॉलम की पोज़िशन दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This logs the value in the very last cell of this sheet
const lastRow = sheet.getLastRow();
const lastColumn = sheet.getLastColumn();
const lastCell = sheet.getRange(lastRow, lastColumn);
Logger.log(lastCell.getValue());

वापसी का टिकट

Integer — यह शीट का आखिरी कॉलम होता है, जिसमें कॉन्टेंट होता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getLastRow()

कॉन्टेंट वाली आखिरी लाइन की पोज़िशन दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This logs the value in the very last cell of this sheet
const lastRow = sheet.getLastRow();
const lastColumn = sheet.getLastColumn();
const lastCell = sheet.getRange(lastRow, lastColumn);
Logger.log(lastCell.getValue());

वापसी का टिकट

Integer — यह शीट की आखिरी लाइन होती है, जिसमें कॉन्टेंट मौजूद होता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getMaxIterativeCalculationCycles()

यह फ़ंक्शन, इटरेटिव कैलकुलेशन के दौरान इस्तेमाल किए जाने वाले ज़्यादा से ज़्यादा इटरेशन की संख्या दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Sets the max iterative calculation cycles for the spreadsheet.
ss.setMaxIterativeCalculationCycles(10);

// Logs the max iterative calculation cycles to the console.
console.log(ss.getMaxIterativeCalculationCycles());

वापसी का टिकट

Integer — कैलकुलेशन के लिए ज़्यादा से ज़्यादा इटरेशन की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getName()

इससे दस्तावेज़ का नाम मिलता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
Logger.log(ss.getName());

वापसी का टिकट

String — स्प्रेडशीट का नाम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getNamedRanges()

इस स्प्रेडशीट में मौजूद सभी नेम रेंज को दिखाता है.

// The code below logs the name of the first named range.
const namedRanges = SpreadsheetApp.getActiveSpreadsheet().getNamedRanges();
for (let i = 0; i < namedRanges.length; i++) {
  Logger.log(namedRanges[i].getName());
}

वापसी का टिकट

NamedRange[] — स्प्रेडशीट में मौजूद सभी नाम वाली रेंज की एक ऐरे.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getNumSheets()

यह फ़ंक्शन, इस स्प्रेडशीट में मौजूद शीट की संख्या दिखाता है.

// The code below logs the number of sheets in the active spreadsheet.
Logger.log(SpreadsheetApp.getActiveSpreadsheet().getNumSheets());

वापसी का टिकट

Integer — स्प्रेडशीट में मौजूद शीट की संख्या.


getOwner()

यह फ़ंक्शन, दस्तावेज़ के मालिक का नाम दिखाता है. अगर दस्तावेज़, शेयर की गई ड्राइव में है, तो यह null दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const owner = ss.getOwner();
Logger.log(owner.getEmail());

वापसी का टिकट

User — दस्तावेज़ का मालिक या null, अगर दस्तावेज़ किसी शेयर की गई ड्राइव में है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getPredefinedSpreadsheetThemes()

पहले से तय की गई थीम की सूची दिखाता है.

// The code below returns the list of predefined themes.
const predefinedThemesList =
    SpreadsheetApp.getActiveSpreadsheet().getPredefinedSpreadsheetThemes();

वापसी का टिकट

SpreadsheetTheme[] — पहले से तय की गई थीम की सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getProtections(type)

यह स्प्रेडशीट में सुरक्षित की गई सभी रेंज या शीट को दिखाने वाले ऑब्जेक्ट की कैटगरी को दिखाता है.

// Remove all range protections in the spreadsheet that the user has permission
// to edit.
const ss = SpreadsheetApp.getActive();
const protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE);
for (let i = 0; i < protections.length; i++) {
  const protection = protections[i];
  if (protection.canEdit()) {
    protection.remove();
  }
}
// Remove all sheet protections in the spreadsheet that the user has permission
// to edit.
const ss = SpreadsheetApp.getActive();
const protections = ss.getProtections(SpreadsheetApp.ProtectionType.SHEET);
for (let i = 0; i < protections.length; i++) {
  const protection = protections[i];
  if (protection.canEdit()) {
    protection.remove();
  }
}

पैरामीटर

नामटाइपब्यौरा
typeProtectionTypeसंरक्षित क्षेत्र का टाइप, SpreadsheetApp.ProtectionType.RANGE या SpreadsheetApp.ProtectionType.SHEET.

वापसी का टिकट

Protection[] — यह ऑब्जेक्ट की एक कैटगरी है. इसमें स्प्रेडशीट में सुरक्षित की गई सभी रेंज या शीट शामिल होती हैं.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getRange(a1Notation)

यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताई गई रेंज दिखाता है.

// Get a range A1:D4 on sheet titled "Invoices"
const ss = SpreadsheetApp.getActiveSpreadsheet();
const range = ss.getRange('Invoices!A1:D4');

// Get cell A1 on the first sheet
const sheet = ss.getSheets()[0];
const cell = sheet.getRange('A1');

पैरामीटर

नामटाइपब्यौरा
a1NotationStringA1 नोटेशन या R1C1 नोटेशन में बताई गई वह रेंज जिसे वापस लाना है.

वापसी का टिकट

Range — तय की गई जगह पर मौजूद रेंज.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getRangeByName(name)

यह फ़ंक्शन, किसी नाम वाली रेंज दिखाता है. अगर दिए गए नाम वाली कोई रेंज नहीं मिलती है, तो यह null दिखाता है. अगर स्प्रेडशीट की कई शीट में एक ही रेंज के नाम का इस्तेमाल किया जाता है, तो शीट का नाम बिना अतिरिक्त कोटेशन मार्क के डालें. उदाहरण के लिए, getRangeByName('TaxRates') या getRangeByName('Sheet Name!TaxRates'), लेकिन getRangeByName('"Sheet Name"!TaxRates') नहीं.

// Log the number of columns for the range named 'TaxRates' in the active
// spreadsheet.
const range = SpreadsheetApp.getActiveSpreadsheet().getRangeByName('TaxRates');
if (range != null) {
  Logger.log(range.getNumColumns());
}

पैरामीटर

नामटाइपब्यौरा
nameStringउस रेंज का नाम जिसे पाना है.

वापसी का टिकट

Range — दिए गए नाम वाली सेल की रेंज.


getRangeList(a1Notations)

यह फ़ंक्शन, उसी शीट में मौजूद उन रेंज का RangeList कलेक्शन दिखाता है जिन्हें A1 नोटेशन या R1C1 नोटेशन की ऐसी सूची से तय किया गया है जिसमें कोई वैल्यू मौजूद है.

// Get a list of ranges A1:D4, F1:H4.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const rangeList = sheet.getRangeList(['A1:D4', 'F1:H4']);

पैरामीटर

नामटाइपब्यौरा
a1NotationsString[]A1 नोटेशन या R1C1 नोटेशन में बताई गई, वापस लानी है वाली रेंज की सूची.

वापसी का टिकट

RangeList — तय की गई जगह पर मौजूद रेंज की सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getRecalculationInterval()

इस स्प्रेडशीट के लिए, कैलकुलेशन इंटरवल दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Logs the calculation interval for the spreadsheet to the console.
console.log(ss.getRecalculationInterval().toString());

वापसी का टिकट

RecalculationInterval — इस स्प्रेडशीट के लिए, कैलकुलेशन का इंटरवल.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getRowHeight(rowPosition)

इस तरीके से, दी गई लाइन की ऊंचाई पिक्सल में मिलती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Rows start at 1
Logger.log(sheet.getRowHeight(1));

पैरामीटर

नामटाइपब्यौरा
rowPositionIntegerजांच की जाने वाली लाइन की पोज़िशन.

वापसी का टिकट

Integer — पिक्सल में लाइन की ऊंचाई.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSelection()

यह फ़ंक्शन, स्प्रेडशीट में मौजूद मौजूदा Selection दिखाता है.

const selection = SpreadsheetApp.getActiveSpreadsheet().getSelection();
const currentCell = selection.getCurrentCell();

वापसी का टिकट

Selection — फ़िलहाल चुना गया आइटम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSheetById(id)

इस फ़ंक्शन से, दिए गए आईडी वाली शीट मिलती है. Sheet.getSheetId() का उपयोग करें.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetById(12345);

पैरामीटर

नामटाइपब्यौरा
idIntegerजिस शीट को पाना है उसका आईडी.

वापसी का टिकट

Sheet — अगर कोई शीट नहीं मिलती है, तो दिए गए आईडी वाली शीट या null.


getSheetByName(name)

यह फ़ंक्शन, दिए गए नाम वाली शीट दिखाता है.

अगर कई शीट के नाम एक जैसे हैं, तो सबसे बाईं ओर वाली शीट का नाम दिखाया जाता है. अगर दिए गए नाम की कोई शीट मौजूद नहीं है, तो null दिखाता है.

// The code below logs the index of a sheet named "Expenses"
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Expenses');
if (sheet != null) {
  Logger.log(sheet.getIndex());
}

पैरामीटर

नामटाइपब्यौरा
nameStringउस शीट का नाम जिसे पाना है.

वापसी का टिकट

Sheet — इस नाम की शीट.


getSheetId()

यह फ़ंक्शन, इस ऑब्जेक्ट से जुड़ी शीट का आईडी दिखाता है.

यह शीट का आईडी है, जो स्प्रेडशीट के लिए यूनीक होता है. यह आईडी, शीट बनाते समय असाइन किया गया पूर्णांक होता है. यह लगातार बढ़ता रहता है. यह शीट की पोज़िशन से अलग होता है. यह Range.copyFormatToRange(gridId, column, columnEnd, row, rowEnd) जैसे तरीकों के साथ काम करता है. ये तरीके, Sheet इंस्टेंस के बजाय gridId पैरामीटर लेते हैं.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

Logger.log(sheet.getSheetId());

वापसी का टिकट

Integer — यह शीट का आईडी होता है. यह स्प्रेडशीट के लिए यूनीक होता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSheetName()

यह फ़ंक्शन, शीट का नाम दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

Logger.log(sheet.getSheetName());

वापसी का टिकट

String — यह शीट का नाम है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSheetValues(startRow, startColumn, numRows, numColumns)

यह फ़ंक्शन, दिए गए कोऑर्डिनेट से शुरू होने वाली इस रेंज के लिए, वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है. पंक्ति या कॉलम की पोज़िशन के तौर पर दी गई -1 वैल्यू का मतलब है कि आपको शीट में मौजूद डेटा वाली आखिरी पंक्ति या कॉलम चाहिए.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// The two samples below produce the same output
let values = sheet.getSheetValues(1, 1, 3, 3);
Logger.log(values);

const range = sheet.getRange(1, 1, 3, 3);
values = range.getValues();
Logger.log(values);

पैरामीटर

नामटाइपब्यौरा
startRowIntegerशुरुआती लाइन की पोज़िशन.
startColumnIntegerशुरुआती कॉलम की पोज़िशन.
numRowsIntegerउन पंक्तियों की संख्या जिनके लिए वैल्यू दिखानी हैं.
numColumnsIntegerकितने कॉलम की वैल्यू दिखानी हैं.

वापसी का टिकट

Object[][] — वैल्यू की दो डाइमेंशन वाली सरणी.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSheets()

इस स्प्रेडशीट की सभी शीट मिलती हैं.

// The code below logs the name of the second sheet
const sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
// Iterates through the sheets and logs the name and ID of each sheet.
for (const sheet of sheets) {
  Logger.log(`name: ${sheet.getName()}, ID: ${sheet.getSheetId()}`);
}

वापसी का टिकट

Sheet[] — स्प्रेडशीट में मौजूद सभी शीट की एक ऐरे.


getSpreadsheetLocale()

स्प्रेडशीट का स्थान-भाषा सेट करता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Gets the spreadsheet locale.
const ssLocale = ss.getSpreadsheetLocale();

// Logs the locale to the console.
console.log(ssLocale);

वापसी का टिकट

String — स्प्रेडशीट की स्थान-भाषा.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSpreadsheetTheme()

यह फ़ंक्शन, स्प्रेडशीट की मौजूदा थीम दिखाता है. अगर कोई थीम लागू नहीं की गई है, तो यह null दिखाता है.

// The code below returns the current theme of the spreadsheet.
const currentTheme =
    SpreadsheetApp.getActiveSpreadsheet().getSpreadsheetTheme();

वापसी का टिकट

SpreadsheetTheme — यह मौजूदा थीम है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSpreadsheetTimeZone()

स्प्रेडशीट के टाइम ज़ोन की जानकारी मिलती है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Sets the time zone of the spreadsheet.
ss.setSpreadsheetTimeZone('America/New_York');

// Gets the time zone of the spreadsheet.
const ssTimeZone = ss.getSpreadsheetTimeZone();

// Logs the time zone to the console.
console.log(ssTimeZone);

वापसी का टिकट

String — समय क्षेत्र, जिसे "long" फ़ॉर्मैट में तय किया गया है. उदाहरण के लिए, Joda.org की सूची के मुताबिक, "America/New_York".

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getUrl()

यह फ़ंक्शन, दी गई स्प्रेडशीट के लिए यूआरएल दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
Logger.log(ss.getUrl());

वापसी का टिकट

String — दी गई स्प्रेडशीट का यूआरएल.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getViewers()

इस Spreadsheet के लिए, दर्शकों और टिप्पणी करने वालों की सूची मिलती है.

वापसी का टिकट

User[] — यह व्यू या टिप्पणी करने की अनुमति वाले उपयोगकर्ताओं का कलेक्शन होता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

hideColumn(column)

यह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को छिपाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This hides the first column
let range = sheet.getRange('A1');
sheet.hideColumn(range);

// This hides the first 3 columns
range = sheet.getRange('A:C');
sheet.hideColumn(range);

पैरामीटर

नामटाइपब्यौरा
columnRangeछिपाने के लिए कॉलम की रेंज.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

hideRow(row)

यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों को छिपाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This hides the first row
const range = sheet.getRange('A1');
sheet.hideRow(range);

पैरामीटर

नामटाइपब्यौरा
rowRangeछिपाने के लिए पंक्तियों की रेंज.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertColumnAfter(afterPosition)

यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद एक कॉलम जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This inserts a column after the first column position
sheet.insertColumnAfter(1);

पैरामीटर

नामटाइपब्यौरा
afterPositionIntegerवह कॉलम जिसके बाद नया कॉलम जोड़ा जाना चाहिए.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertColumnBefore(beforePosition)

यह फ़ंक्शन, दी गई कॉलम की पोज़िशन से पहले एक कॉलम जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This inserts a column in the first column position
sheet.insertColumnBefore(1);

पैरामीटर

नामटाइपब्यौरा
beforePositionIntegerवह कॉलम जिसके पहले नया कॉलम जोड़ा जाना चाहिए.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertColumnsAfter(afterPosition, howMany)

यह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद, तय किए गए कॉलम की संख्या को जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Inserts two columns after the first column on the first sheet of the
// spreadsheet.
sheet.insertColumnsAfter(1, 2);

पैरामीटर

नामटाइपब्यौरा
afterPositionIntegerवह कॉलम जिसके बाद नया कॉलम जोड़ा जाना चाहिए.
howManyIntegerकॉलम की संख्या.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertColumnsBefore(beforePosition, howMany)

यह फ़ंक्शन, कॉलम की दी गई पोज़िशन से पहले कई कॉलम जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This inserts five columns before the first column
sheet.insertColumnsBefore(1, 5);

पैरामीटर

नामटाइपब्यौरा
beforePositionIntegerवह कॉलम जिसके पहले नया कॉलम जोड़ा जाना चाहिए.
howManyIntegerकॉलम की संख्या.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertDataSourceSheet(spec)

यह स्प्रेडशीट में एक नया DataSourceSheet जोड़ता है और डेटा को प्रोसेस करना शुरू करता है. इसके अलावा, इससे नई शीट भी ऐक्टिव हो जाती है.

अगर डेटा सोर्स टाइप चालू नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है. किसी खास तरह के डेटा सोर्स का डेटा प्रोसेस करने के लिए, SpreadsheetApp#enable...Execution() तरीकों का इस्तेमाल करें.

// Activates BigQuery operations.
SpreadsheetApp.enableBigQueryExecution();

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet()
// instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Builds a data source specification.
// TODO (developer): Update the project ID to your own Google Cloud project ID.
const dataSourceSpec = SpreadsheetApp.newDataSourceSpec()
                           .asBigQuery()
                           .setProjectId('project-id-1')
                           .setTableProjectId('bigquery-public-data')
                           .setDatasetId('ncaa_basketball')
                           .setTableId('mbb_historical_teams_games')
                           .build();

// Adds the data source and its data to the spreadsheet.
ss.insertDataSourceSheet(dataSourceSpec);

पैरामीटर

नामटाइपब्यौरा
specDataSourceSpecडेटा सोर्स स्पेसिफ़िकेशन, जिसे शामिल करना है.

वापसी का टिकट

DataSourceSheet — नई डेटा सोर्स शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertImage(blobSource, column, row)

यह फ़ंक्शन, किसी दस्तावेज़ में दी गई पंक्ति और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है. इमेज का साइज़, blob के कॉन्टेंट से लिया जाता है. BLOB का साइज़ ज़्यादा से ज़्यादा 2 एमबी हो सकता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

const binaryData = [];  // TODO(developer): Replace with your binary data.
const blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName');
sheet.insertImage(blob, 1, 1);

पैरामीटर

नामटाइपब्यौरा
blobSourceBlobSourceइमेज के कॉन्टेंट, MIME टाइप, और (ज़रूरी नहीं) नाम वाला ब्लॉब.
columnIntegerकॉलम की पोज़िशन.
rowIntegerलाइन की पोज़िशन.

वापसी का टिकट

OverGridImage — यह डाली गई इमेज है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertImage(blobSource, column, row, offsetX, offsetY)

यह फ़ंक्शन, किसी दस्तावेज़ में दी गई लाइन और कॉलम में Spreadsheet को इमेज के तौर पर शामिल करता है. साथ ही, पिक्सल ऑफ़सेट भी तय करता है. इमेज का साइज़, blob के कॉन्टेंट से लिया जाता है. BLOB का साइज़ ज़्यादा से ज़्यादा 2 एमबी हो सकता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

const binaryData = [];  // TODO(developer): Replace with your binary data.
const blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName');
sheet.insertImage(blob, 1, 1, 10, 10);

पैरामीटर

नामटाइपब्यौरा
blobSourceBlobSourceइमेज के कॉन्टेंट, MIME टाइप, और (ज़रूरी नहीं) नाम वाला ब्लॉब.
columnIntegerकॉलम की पोज़िशन.
rowIntegerलाइन की पोज़िशन.
offsetXIntegerसेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट, पिक्सल में.
offsetYIntegerसेल के कोने से वर्टिकल ऑफ़सेट, पिक्सल में.

वापसी का टिकट

OverGridImage — यह डाली गई इमेज है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertImage(url, column, row)

दस्तावेज़ में किसी दी गई पंक्ति और कॉलम में इमेज डालता है.

दिया गया यूआरएल, सार्वजनिक तौर पर ऐक्सेस किया जा सकने वाला होना चाहिए.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

sheet.insertImage('https://www.google.com/images/srpr/logo3w.png', 1, 1);

पैरामीटर

नामटाइपब्यौरा
urlStringइमेज का यूआरएल.
columnIntegerग्रिड कॉलम की पोज़िशन.
rowIntegerग्रिड की लाइन की पोज़िशन.

वापसी का टिकट

OverGridImage — यह डाली गई इमेज है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertImage(url, column, row, offsetX, offsetY)

यह फ़ंक्शन, दस्तावेज़ में किसी इमेज को तय की गई लाइन और कॉलम में पिक्सल ऑफ़सेट के साथ जोड़ता है.

दिया गया यूआरएल, सार्वजनिक तौर पर ऐक्सेस किया जा सकने वाला होना चाहिए.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

sheet.insertImage(
    'https://www.google.com/images/srpr/logo3w.png',
    1,
    1,
    10,
    10,
);

पैरामीटर

नामटाइपब्यौरा
urlStringइमेज का यूआरएल.
columnIntegerकॉलम की पोज़िशन.
rowIntegerलाइन की पोज़िशन.
offsetXIntegerसेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट, पिक्सल में.
offsetYIntegerसेल के कोने से वर्टिकल ऑफ़सेट, पिक्सल में.

वापसी का टिकट

OverGridImage — डाली गई इमेज.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertRowAfter(afterPosition)

यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद एक पंक्ति जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This inserts a row after the first row position
sheet.insertRowAfter(1);

पैरामीटर

नामटाइपब्यौरा
afterPositionIntegerवह लाइन जिसके बाद नई लाइन जोड़ी जानी चाहिए.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertRowBefore(beforePosition)

यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले एक पंक्ति जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This inserts a row before the first row position
sheet.insertRowBefore(1);

पैरामीटर

नामटाइपब्यौरा
beforePositionIntegerवह लाइन जिसके पहले नई लाइन जोड़ी जानी चाहिए.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertRowsAfter(afterPosition, howMany)

यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद कई पंक्तियां जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This inserts five rows after the first row
sheet.insertRowsAfter(1, 5);

पैरामीटर

नामटाइपब्यौरा
afterPositionIntegerवह पंक्ति जिसके बाद नई पंक्तियां जोड़ी जानी चाहिए.
howManyIntegerडालने के लिए पंक्तियों की संख्या.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertRowsBefore(beforePosition, howMany)

यह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले कई पंक्तियां जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This inserts five rows before the first row
sheet.insertRowsBefore(1, 5);

पैरामीटर

नामटाइपब्यौरा
beforePositionIntegerवह लाइन जिसके पहले नई लाइनें जोड़ी जानी चाहिए.
howManyIntegerडालने के लिए पंक्तियों की संख्या.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet()

यह फ़ंक्शन, स्प्रेडशीट में डिफ़ॉल्ट नाम वाली नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.insertSheet();

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet(sheetIndex)

यह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर एक नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.insertSheet(1);

पैरामीटर

नामटाइपब्यौरा
sheetIndexIntegerनई बनाई गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर डालने के लिए, उसे 0 पर सेट करें.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet(sheetIndex, options)

यह फ़ंक्शन, दी गई इंडेक्स वैल्यू के हिसाब से स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, इसमें वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const templateSheet = ss.getSheetByName('Sales');
ss.insertSheet(1, {template: templateSheet});

पैरामीटर

नामटाइपब्यौरा
sheetIndexIntegerनई बनाई गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर डालने के लिए, उसे 0 पर सेट करें.
optionsObjectJavaScript के बेहतर आर्ग्युमेंट (ज़रूरी नहीं).

उन्नत पैरामीटर

नामटाइपब्यौरा
templateSheetटेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी हो जाता है. शीट टेंप्लेट, Spreadsheet ऑब्जेक्ट की किसी एक शीट में होना चाहिए.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet(options)

यह फ़ंक्शन, स्प्रेडशीट में नई शीट जोड़ता है. इसके लिए, शीट के डिफ़ॉल्ट नाम और वैकल्पिक तौर पर ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जाता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const templateSheet = ss.getSheetByName('Sales');
ss.insertSheet({template: templateSheet});

पैरामीटर

नामटाइपब्यौरा
optionsObjectJavaScript के बेहतर विकल्प वाले वैकल्पिक तर्क. इनकी सूची यहां दी गई है.

उन्नत पैरामीटर

नामटाइपब्यौरा
templateSheetटेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी हो जाता है. शीट टेंप्लेट, इस स्प्रेडशीट ऑब्जेक्ट की किसी एक शीट का होना चाहिए.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet(sheetName)

यह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.insertSheet('My New Sheet');

पैरामीटर

नामटाइपब्यौरा
sheetNameStringनई शीट का नाम.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet(sheetName, sheetIndex)

यह फ़ंक्शन, स्प्रेडशीट में दिए गए इंडेक्स पर, दिए गए नाम की नई शीट जोड़ता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.insertSheet('My New Sheet', 1);

पैरामीटर

नामटाइपब्यौरा
sheetNameStringनई शीट का नाम.
sheetIndexIntegerनई बनाई गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर डालने के लिए, उसे 0 पर सेट करें.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet(sheetName, sheetIndex, options)

यह फ़ंक्शन, स्प्रैडशीट में दी गई इंडेक्स वैल्यू पर दिए गए नाम की नई शीट जोड़ता है. साथ ही, यह ज़रूरत के हिसाब से ऐडवांस आर्ग्युमेंट का इस्तेमाल करता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const templateSheet = ss.getSheetByName('Sales');
ss.insertSheet('My New Sheet', 1, {template: templateSheet});

पैरामीटर

नामटाइपब्यौरा
sheetNameStringनई शीट का नाम.
sheetIndexIntegerनई जोड़ी गई शीट का इंडेक्स. किसी शीट को स्प्रेडशीट में पहली शीट के तौर पर डालने के लिए, इसे 0 पर सेट करें.
optionsObjectJavaScript के बेहतर आर्ग्युमेंट (ज़रूरी नहीं).

उन्नत पैरामीटर

नामटाइपब्यौरा
templateSheetटेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी हो जाता है. शीट टेंप्लेट, Spreadsheet ऑब्जेक्ट की किसी एक शीट में होना चाहिए.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheet(sheetName, options)

यह फ़ंक्शन, दी गई स्प्रेडशीट में दिए गए नाम की एक नई शीट जोड़ता है. साथ ही, इसमें ऐडवांस आर्ग्युमेंट का इस्तेमाल किया जा सकता है. नई शीट, ऐक्टिव शीट बन जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const templateSheet = ss.getSheetByName('Sales');
ss.insertSheet('My New Sheet', {template: templateSheet});

पैरामीटर

नामटाइपब्यौरा
sheetNameStringनई शीट का नाम.
optionsObjectJavaScript के बेहतर आर्ग्युमेंट (ज़रूरी नहीं).

उन्नत पैरामीटर

नामटाइपब्यौरा
templateSheetटेंप्लेट शीट ऑब्जेक्ट का पूरा डेटा, नई शीट में कॉपी हो जाता है. शीट टेंप्लेट, Spreadsheet ऑब्जेक्ट की किसी एक शीट में होना चाहिए.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

insertSheetWithDataSourceTable(spec)

यह स्प्रेडशीट में एक नई शीट जोड़ता है. साथ ही, दिए गए डेटा सोर्स स्पेसिफ़िकेशन के साथ पूरी शीट में फ़ैला हुआ DataSourceTable बनाता है और डेटा को प्रोसेस करना शुरू करता है. इसका एक साइड इफ़ेक्ट यह है कि नई शीट, ऐक्टिव शीट बन जाती है.

अगर डेटा सोर्स टाइप चालू नहीं है, तो यह फ़ंक्शन एक अपवाद दिखाता है. किसी खास तरह के डेटा सोर्स का डेटा प्रोसेस करने के लिए, SpreadsheetApp#enable...Execution() तरीकों का इस्तेमाल करें.

// Activates BigQuery operations.
SpreadsheetApp.enableBigQueryExecution();

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet()
// instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Adds a sheet and sets cell A1 as the parameter cell.
const parameterCell = ss.insertSheet('parameterSheet').getRange('A1');

// Sets the value of the parameter cell to 'Duke'.
parameterCell.setValue('Duke');

const query = 'select * from `bigquery-public-data`.`ncaa_basketball`.' +
    '`mbb_historical_tournament_games` WHERE win_school_ncaa = @SCHOOL';

// Adds a data source with a query parameter.
// TODO(developer): Update the project ID to your own Google Cloud project ID.
const dataSourceSpec = SpreadsheetApp.newDataSourceSpec()
                           .asBigQuery()
                           .setProjectId('project-id-1')
                           .setRawQuery(query)
                           .setParameterFromCell('SCHOOL', 'parameterSheet!A1')
                           .build();

// Adds sheets for the data source and data source table to the spreadsheet.
ss.insertSheetWithDataSourceTable(dataSourceSpec);

पैरामीटर

नामटाइपब्यौरा
specDataSourceSpecडेटा सोर्स स्पेसिफ़िकेशन, जिसे शामिल करना है.

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

isColumnHiddenByUser(columnPosition)

यह फ़ंक्शन बताता है कि उपयोगकर्ता ने दी गई कॉलम को छिपाया है या नहीं.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Columns start at 1
Logger.log(sheet.isColumnHiddenByUser(1));

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerजांच किए जाने वाले कॉलम की पोज़िशन.

वापसी का टिकट

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());

वापसी का टिकट

Booleantrue अगर इटरेटिव कैलकुलेशन चालू है, तो false नहीं तो.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

isRowHiddenByFilter(rowPosition)

यह फ़ंक्शन बताता है कि दी गई लाइन को फ़िल्टर (फ़िल्टर व्यू नहीं) की मदद से छिपाया गया है या नहीं.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Rows start at 1
Logger.log(sheet.isRowHiddenByFilter(1));

पैरामीटर

नामटाइपब्यौरा
rowPositionIntegerजांच की जाने वाली लाइन की पोज़िशन.

वापसी का टिकट

Boolean — अगर लाइन छिपी हुई है, तो true. अगर लाइन नहीं छिपी हुई है, तो false.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

isRowHiddenByUser(rowPosition)

इससे यह पता चलता है कि दी गई लाइन को उपयोगकर्ता ने छिपाया है या नहीं.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Rows start at 1
Logger.log(sheet.isRowHiddenByUser(1));

पैरामीटर

नामटाइपब्यौरा
rowPositionIntegerजांच की जाने वाली लाइन की पोज़िशन.

वापसी का टिकट

Boolean — अगर लाइन छिपी हुई है, तो true. अगर लाइन नहीं छिपी हुई है, तो false.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

moveActiveSheet(pos)

इस फ़ंक्शन की मदद से, चालू शीट को शीट की सूची में दी गई जगह पर ले जाया जाता है. अगर पोज़िशन नेगेटिव है या शीट की संख्या से ज़्यादा है, तो यह फ़ंक्शन एक अपवाद दिखाता है.

// This example assumes that there are 2 sheets in the current
// active spreadsheet: one named "first" in position 1 and another named
// "second" in position 2.
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
// Gets the "first" sheet and activates it.
const sheet = spreadsheet.getSheetByName('first').activate();

// Logs 'Current index of sheet: 1'
console.log('Current index of sheet: %s', sheet.getIndex());

spreadsheet.moveActiveSheet(2);

// Logs 'New index of sheet: 2'
console.log('New index of sheet: %s', sheet.getIndex());

पैरामीटर

नामटाइपब्यौरा
posIntegerशीट की सूची में, ऐक्टिव शीट को ले जाने के लिए 1-इंडेक्स वाली पोज़िशन.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

moveChartToObjectSheet(chart)

यह फ़ंक्शन, नई SheetType.OBJECT शीट बनाता है और दिए गए चार्ट को उसमें ले जाता है. अगर चार्ट पहले से ही किसी शीट पर मौजूद है, तो नई शीट बनाए बिना ही उस शीट को वापस भेज दिया जाता है.

const sheet = SpreadsheetApp.getActiveSheet();
const chart = sheet.newChart().setPosition(1, 1, 0, 0).build();
sheet.insertChart(chart);
const objectSheet = SpreadsheetApp.getActive().moveChartToObjectSheet(chart);

पैरामीटर

नामटाइपब्यौरा
chartEmbeddedChartवह चार्ट जिसे दूसरी जगह ले जाना है.

वापसी का टिकट

Sheet — वह शीट जिस पर चार्ट मौजूद है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

refreshAllDataSources()

यह सुविधा, काम करने वाले सभी डेटा सोर्स और उनसे लिंक किए गए डेटा सोर्स ऑब्जेक्ट को रीफ़्रेश करती है. साथ ही, अमान्य डेटा सोर्स ऑब्जेक्ट को छोड़ देती है.

किसी खास तरह के डेटा सोर्स का डेटा प्रोसेस करने के लिए, SpreadsheetApp#enable...Execution() तरीकों का इस्तेमाल करें.

// Activates BigQuery operations.
SpreadsheetApp.enableBigQueryExecution();

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet()
// instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Gets the first data source sheet on the spreadsheet.
const dataSheet = ss.getDataSourceSheets()[0];

// Refreshes all data sources on the spreadsheet.
ss.refreshAllDataSources();

// Logs the last refreshed time of the first data source sheet.
console.log(
    `Last refresh time: ${dataSheet.getStatus().getLastRefreshedTime()}`,
);

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

removeEditor(emailAddress)

इस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के संपादकों की सूची से हटा दिया जाता है. अगर उपयोगकर्ता ऐसे लोगों की कैटगरी में आता है जिनके पास सामान्य ऐक्सेस है, तो इस तरीके से उन्हें Spreadsheet ऐक्सेस करने से नहीं रोका जा सकता. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.

Drive में मौजूद फ़ाइलों के लिए, इससे उपयोगकर्ता को व्यूअर की सूची से भी हटा दिया जाता है.

पैरामीटर

नामटाइपब्यौरा
emailAddressStringउस उपयोगकर्ता का ईमेल पता जिसे हटाना है.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

removeEditor(user)

इस विकल्प से, दिए गए उपयोगकर्ता को Spreadsheet के संपादकों की सूची से हटा दिया जाता है. अगर उपयोगकर्ता ऐसे लोगों की कैटगरी में आता है जिनके पास सामान्य ऐक्सेस है, तो इस तरीके से उन्हें Spreadsheet ऐक्सेस करने से नहीं रोका जा सकता. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.

Drive में मौजूद फ़ाइलों के लिए, इससे उपयोगकर्ता को व्यूअर की सूची से भी हटा दिया जाता है.

पैरामीटर

नामटाइपब्यौरा
userUserउस उपयोगकर्ता का प्रतिनिधित्व जिसे हटाना है.

वापसी का टिकट

Spreadsheet — यह Spreadsheet, चेनिंग के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

removeMenu(name)

addMenu(name, subMenus) ने जो मेन्यू जोड़ा था उसे हटाता है. name आर्ग्युमेंट की वैल्यू, addMenu(name, subMenus) को किए गए कॉल की वैल्यू के बराबर होनी चाहिए.

// The onOpen function is executed automatically every time a Spreadsheet is
// loaded
function onOpen() {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  ss.addMenu('badMenu', [
    {name: 'remove bad menu', functionName: 'removeBadMenu'},
    {name: 'foo', functionName: 'foo'},
  ]);
}
function removeBadMenu() {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  ss.removeMenu(
      'badMenu');  // name must match the name used when added the menu
}
function foo() {
  // Do nothing
}

पैरामीटर

नामटाइपब्यौरा
nameStringहटाए जाने वाले मेन्यू का नाम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

removeNamedRange(name)

इस फ़ंक्शन का इस्तेमाल करके, दिए गए नाम वाली रेंज को मिटाया जा सकता है. अगर स्प्रेडशीट में दिए गए नाम वाली कोई रेंज नहीं मिलती है, तो यह फ़ंक्शन एक अपवाद दिखाता है.

// The code below creates a new named range "foo", and then remove it.
const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.setNamedRange('foo', ss.getActiveRange());
ss.removeNamedRange('foo');

पैरामीटर

नामटाइपब्यौरा
nameStringरेंज का नाम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

removeViewer(emailAddress)

यह दिए गए उपयोगकर्ता को Spreadsheet के लिए, दर्शकों और टिप्पणीकारों की सूची से हटाता है. अगर उपयोगकर्ता व्यूअर या टिप्पणीकार के बजाय एडिटर है, तो इस तरीके का कोई असर नहीं पड़ता. इस तरीके से, उन उपयोगकर्ताओं को भी Spreadsheet ऐक्सेस करने से नहीं रोका जाता जो उपयोगकर्ताओं की ऐसी क्लास से जुड़े हैं जिनके पास सामान्य ऐक्सेस है. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet किसी ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.

Drive की फ़ाइलों के लिए, इससे उपयोगकर्ता को संपादकों की सूची से भी हटा दिया जाता है.

पैरामीटर

नामटाइपब्यौरा
emailAddressStringउस उपयोगकर्ता का ईमेल पता जिसे हटाना है.

वापसी का टिकट

Spreadsheet — This Spreadsheet for chaining.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

removeViewer(user)

यह दिए गए उपयोगकर्ता को Spreadsheet के लिए, दर्शकों और टिप्पणीकारों की सूची से हटाता है. अगर उपयोगकर्ता व्यूअर के बजाय एडिटर है, तो इस तरीके का कोई असर नहीं पड़ता. इस तरीके से, उन उपयोगकर्ताओं को Spreadsheet ऐक्सेस करने से भी नहीं रोका जा सकता जो उपयोगकर्ताओं की ऐसी क्लास से जुड़े हैं जिनके पास सामान्य ऐक्सेस है. उदाहरण के लिए, अगर Spreadsheet को उपयोगकर्ता के पूरे डोमेन के साथ शेयर किया गया है या अगर Spreadsheet किसी ऐसी शेयर की गई ड्राइव में है जिसे उपयोगकर्ता ऐक्सेस कर सकता है.

Drive की फ़ाइलों के लिए, इससे उपयोगकर्ता को संपादकों की सूची से भी हटा दिया जाता है.

पैरामीटर

नामटाइपब्यौरा
userUserउस उपयोगकर्ता का प्रतिनिधित्व जिसे हटाना है.

वापसी का टिकट

Spreadsheet — This Spreadsheet for chaining.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

rename(newName)

दस्तावेज़ का नाम बदलता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.rename('This is the new name');

पैरामीटर

नामटाइपब्यौरा
newNameStringदस्तावेज़ का नया नाम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • 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');

पैरामीटर

नामटाइपब्यौरा
newNameStringमौजूदा ऐक्टिव शीट का नया नाम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

resetSpreadsheetTheme()

यह फ़ंक्शन, स्प्रेडशीट पर लागू की गई थीम को हटाता है और डिफ़ॉल्ट थीम सेट करता है.

// The code below applies default theme on the spreadsheet.
SpreadsheetApp.getActiveSpreadsheet().resetSpreadsheetTheme();

वापसी का टिकट

SpreadsheetTheme — डिफ़ॉल्ट थीम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setActiveRange(range)

यह फ़ंक्शन, चुनी गई रेंज को चालू शीट में active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर मौजूद बाएं सेल को current cell के तौर पर सेट करता है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const range = sheet.getRange('A1:D4');
sheet.setActiveRange(range);

const selection = sheet.getSelection();
// Current cell: A1
const currentCell = selection.getCurrentCell();
// Active Range: A1:D4
const activeRange = selection.getActiveRange();

पैरामीटर

नामटाइपब्यौरा
rangeRangeऐक्टिव रेंज के तौर पर सेट की जाने वाली रेंज.

वापसी का टिकट

Range — नई रेंज चालू की गई है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setActiveRangeList(rangeList)

यह फ़ंक्शन, रेंज की दी गई सूची को ऐक्टिव शीट में active ranges के तौर पर सेट करता है. सूची में मौजूद आखिरी रेंज को active range के तौर पर सेट किया जाता है.

const sheet = SpreadsheetApp.getActiveSheet();
const rangeList = sheet.getRangeList(['D4', 'B2:C4']);
sheet.setActiveRangeList(rangeList);

const selection = sheet.getSelection();
// Current cell: B2
const currentCell = selection.getCurrentCell();
// Active range: B2:C4
const activeRange = selection.getActiveRange();
// Active range list: [D4, B2:C4]
const activeRangeList = selection.getActiveRangeList();

पैरामीटर

नामटाइपब्यौरा
rangeListRangeListचुनी जाने वाली रेंज की सूची.

वापसी का टिकट

RangeList — रेंज की नई चुनी गई सूची.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setActiveSelection(range)

इस शीट के लिए, चुने गए सेल की रेंज सेट करता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

const range = sheet.getRange('A1:D4');
sheet.setActiveSelection(range);

पैरामीटर

नामटाइपब्यौरा
rangeRangeऐक्टिव सिलेक्शन के तौर पर सेट की जाने वाली रेंज.

वापसी का टिकट

Range — नई रेंज चालू की गई है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setActiveSelection(a1Notation)

यह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताए गए हिसाब से, ऐक्टिव सेल को सेट करता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

sheet.setActiveSelection('A1:D4');

पैरामीटर

नामटाइपब्यौरा
a1NotationStringA1 नोटेशन या R1C1 नोटेशन में बताई गई वह रेंज जिसे चालू के तौर पर सेट करना है.

वापसी का टिकट

Range — नई रेंज चालू की गई है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setActiveSheet(sheet)

यह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है. Google Sheets के यूज़र इंटरफ़ेस (यूआई) में, चुनी गई शीट दिखती है. हालांकि, ऐसा तब होता है, जब शीट किसी दूसरी स्प्रेडशीट से जुड़ी न हो.

// The code below makes the first sheet active in the active spreadsheet.
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
spreadsheet.setActiveSheet(spreadsheet.getSheets()[0]);

पैरामीटर

नामटाइपब्यौरा
sheetSheetऐक्टिव शीट के तौर पर सेट की जाने वाली शीट.

वापसी का टिकट

Sheet — यह ऐक्टिव शीट है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setActiveSheet(sheet, restoreSelection)

यह फ़ंक्शन, दी गई शीट को स्प्रेडशीट में ऐक्टिव शीट के तौर पर सेट करता है. साथ ही, उस शीट में सबसे हाल ही में किए गए बदलाव को वापस लाने का विकल्प देता है. Google Sheets का यूज़र इंटरफ़ेस (यूआई), चुनी गई शीट को तब तक दिखाता है, जब तक वह शीट किसी दूसरी स्प्रेडशीट से जुड़ी न हो.

const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const firstSheet = spreadsheet.getSheets()[0];
const secondSheet = spreadsheet.getSheets()[1];
// Set the first sheet as the active sheet and select the range D4:F4.
spreadsheet.setActiveSheet(firstSheet).getRange('D4:F4').activate();

// Switch to the second sheet to do some work.
spreadsheet.setActiveSheet(secondSheet);
// Switch back to first sheet, and restore its selection.
spreadsheet.setActiveSheet(firstSheet, true);

// The selection of first sheet is restored, and it logs D4:F4
const range = spreadsheet.getActiveSheet().getSelection().getActiveRange();
Logger.log(range.getA1Notation());

पैरामीटर

नामटाइपब्यौरा
sheetSheetनई ऐक्टिव शीट.
restoreSelectionBooleantrue दबाने पर, नई ऐक्टिव शीट का सबसे हाल का चुना गया सेल फिर से चुना जाता है, क्योंकि नई शीट ऐक्टिव हो जाती है. वहीं, false दबाने पर, मौजूदा सेल को बदले बिना नई शीट ऐक्टिव हो जाती है.

वापसी का टिकट

Sheet — यह नई ऐक्टिव शीट है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setColumnWidth(columnPosition, width)

इससे दिए गए कॉलम की चौड़ाई पिक्सल में सेट की जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Sets the first column to a width of 200 pixels
sheet.setColumnWidth(1, 200);

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerसेट करने के लिए, दिए गए कॉलम की पोज़िशन.
widthIntegerचौड़ाई को पिक्सल में सेट करने के लिए.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setCurrentCell(cell)

इस फ़ंक्शन से, तय की गई सेल को current cell के तौर पर सेट किया जाता है.

अगर बताई गई सेल, पहले से चुनी गई किसी रेंज में मौजूद है, तो वह रेंज, मौजूदा सेल के साथ ऐक्टिव रेंज बन जाती है.

अगर बताई गई सेल, चुनी गई किसी भी रेंज में मौजूद नहीं है, तो मौजूदा सिलेक्शन हटा दिया जाता है. साथ ही, सेल को मौजूदा सेल और ऐक्टिव रेंज बना दिया जाता है.

ध्यान दें:बताई गई Range में एक सेल होनी चाहिए. ऐसा न होने पर, यह फ़ंक्शन एक अपवाद दिखाता है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const cell = sheet.getRange('B5');
sheet.setCurrentCell(cell);

const selection = sheet.getSelection();
// Current cell: B5
const currentCell = selection.getCurrentCell();

पैरामीटर

नामटाइपब्यौरा
cellRangeवह सेल जिसे मौजूदा सेल के तौर पर सेट करना है.

वापसी का टिकट

Range — नई सेट की गई मौजूदा सेल.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFrozenColumns(columns)

इससे, दी गई संख्या के हिसाब से कॉलम फ़्रीज़ हो जाते हैं. अगर वैल्यू शून्य है, तो कोई कॉलम फ़्रीज़ नहीं किया जाता.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Freezes the first column
sheet.setFrozenColumns(1);

पैरामीटर

नामटाइपब्यौरा
columnsIntegerफ़्रीज़ किए जाने वाले कॉलम की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFrozenRows(rows)

दी गई पंक्तियों की संख्या को फ़्रीज़ करता है. अगर वैल्यू शून्य है, तो कोई भी लाइन फ़्रीज़ नहीं की जाती है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Freezes the first row
sheet.setFrozenRows(1);

पैरामीटर

नामटाइपब्यौरा
rowsIntegerफ़्रीज़ की जाने वाली पंक्तियों की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • 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());

पैरामीटर

नामटाइपब्यौरा
minThresholdNumberकम से कम कन्वर्जेंस थ्रेशोल्ड (शून्य से कम नहीं होना चाहिए).

वापसी का टिकट

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());

पैरामीटर

नामटाइपब्यौरा
isEnabledBooleantrue अगर इटरेटिव कैलकुलेशन चालू करनी है; 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());

पैरामीटर

नामटाइपब्यौरा
maxIterationsIntegerकैलकुलेशन के लिए ज़्यादा से ज़्यादा पुनरावृत्तियां (1 से 10,000 के बीच).

वापसी का टिकट

Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setNamedRange(name, range)

किसी रेंज को नाम देता है.

// The code below creates a new named range "TaxRates" in the active spreadsheet
const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.setNamedRange('TaxRates', SpreadsheetApp.getActiveRange());

पैरामीटर

नामटाइपब्यौरा
nameStringरेंज को दिया जाने वाला नाम.
rangeRangeरेंज की खास जानकारी.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • 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);

पैरामीटर

नामटाइपब्यौरा
recalculationIntervalRecalculationIntervalदोबारा हिसाब लगाने का नया इंटरवल.

वापसी का टिकट

Spreadsheet — यह स्प्रेडशीट, चेन बनाने के लिए है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setRowHeight(rowPosition, height)

यह विकल्प, दी गई लाइन की ऊंचाई को पिक्सल में सेट करता है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियों की ऊंचाई बढ़ जाती है. अगर आपको पंक्तियों को तय की गई ऊंचाई पर सेट करना है, तो Sheet.setRowHeightsForced(startRow, numRows, height) का इस्तेमाल करें.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Sets the first row to a height of 200 pixels
sheet.setRowHeight(1, 200);

पैरामीटर

नामटाइपब्यौरा
rowPositionIntegerबदलाव करने के लिए लाइन की पोज़िशन.
heightIntegerइसे सेट करने के लिए पिक्सल में ऊंचाई.

वापसी का टिकट

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);

पैरामीटर

नामटाइपब्यौरा
localeStringइस्तेमाल किया जाने वाला स्थान-भाषा कोड (उदाहरण के लिए, 'en', 'fr' या 'en_US').

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setSpreadsheetTheme(theme)

इस कुकी का इस्तेमाल स्प्रेडशीट पर थीम सेट करने के लिए किया जाता है.

const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
// The code below sets the second predefined theme as the current theme of the
// spreadsheet.
const predefinedThemesList = spreadsheet.getPredefinedSpreadsheetThemes();
spreadsheet.setSpreadsheetTheme(predefinedThemesList[1]);

पैरामीटर

नामटाइपब्यौरा
themeSpreadsheetThemeलागू की जाने वाली थीम.

वापसी का टिकट

SpreadsheetTheme — नई मौजूदा थीम.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setSpreadsheetTimeZone(timezone)

यह विकल्प, स्प्रेडशीट के लिए टाइम ज़ोन सेट करता है.

// Opens the spreadsheet file by its URL. If you created your script from within
// a Google Sheets spreadsheet, you can use
// SpreadsheetApp.getActiveSpreadsheet() instead.
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

// Sets the time zone of the spreadsheet.
ss.setSpreadsheetTimeZone('America/New_York');

// Gets the time zone of the spreadsheet.
const ssTimeZone = ss.getSpreadsheetTimeZone();

// Logs the time zone to the console.
console.log(ssTimeZone);

पैरामीटर

नामटाइपब्यौरा
timezoneStringसमय क्षेत्र, जिसे "long" फ़ॉर्मैट में बताया गया है. उदाहरण के लिए, Joda.org पर दिए गए "America/New_York".

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

show(userInterface)

यह फ़ंक्शन, उपयोगकर्ता के ब्राउज़र के व्यूपोर्ट के बीच में मौजूद डायलॉग में, कस्टम यूज़र इंटरफ़ेस कॉम्पोनेंट दिखाता है. सर्वर-साइड स्क्रिप्ट का एक्ज़ीक्यूशन निलंबित नहीं किया गया है. सर्वर साइड से कम्यूनिकेट करने के लिए, यूज़र इंटरफ़ेस कॉम्पोनेंट को सर्वर-साइड स्क्रिप्ट पर एसिंक्रोनस कॉलबैक करने होंगे.

अगर सर्वर-साइड स्क्रिप्ट ने पहले कोई ऐसा डायलॉग दिखाया था जिसे अब तक खारिज नहीं किया गया है, तो मौजूदा डायलॉग को, नए डायलॉग के यूज़र इंटरफ़ेस (यूआई) से बदल दिया जाता है.

नीचे दिया गया कोड स्निपेट, एक डायलॉग में सामान्य HtmlService ऐप्लिकेशन दिखाता है. इसमें टाइटल, ऊंचाई, और चौड़ाई तय की गई है:

const htmlApp = HtmlService
                    .createHtmlOutput(
                        '<p>A change of speed, a change of style...</p>',
                        )
                    .setTitle('My HtmlService Application')
                    .setWidth(250)
                    .setHeight(300);

SpreadsheetApp.getActiveSpreadsheet().show(htmlApp);

// The script resumes execution immediately after showing the dialog.

पैरामीटर

नामटाइपब्यौरा
userInterfaceObjectHtmlOutput.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/script.container.ui

sort(columnPosition)

यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से बढ़ते क्रम में लगाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Sorts the sheet by the first column, ascending
sheet.sort(1);

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerजिस कॉलम के हिसाब से क्रम से लगाना है.

वापसी का टिकट

Sheet — यह शीट, मेथड चेनिंग के लिए काम की है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

sort(columnPosition, ascending)

यह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से क्रम में लगाता है. यह पैरामीटर, बढ़ते या घटते क्रम के बारे में बताता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Sorts the sheet by the first column, descending
sheet.sort(1, false);

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerजिस कॉलम के हिसाब से क्रम से लगाना है.
ascendingBooleanबढ़ते क्रम के लिए 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');

पैरामीटर

नामटाइपब्यौरा
msgStringयह मैसेज, सूचना के तौर पर दिखाया जाएगा.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • 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');

पैरामीटर

नामटाइपब्यौरा
msgStringयह मैसेज, सूचना के तौर पर दिखाया जाएगा.
titleStringयह सूचना का वैकल्पिक टाइटल है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • 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);

पैरामीटर

नामटाइपब्यौरा
msgStringयह मैसेज, सूचना के तौर पर दिखाया जाएगा.
titleStringयह सूचना का वैकल्पिक टाइटल है.
timeoutSecondsNumberयह टाइमआउट सेकंड में होता है. अगर null है, तो सूचना डिफ़ॉल्ट रूप से पांच सेकंड तक दिखती है; अगर यह नेगेटिव है, तो सूचना तब तक दिखती है, जब तक उसे खारिज नहीं किया जाता.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

unhideColumn(column)

यह फ़ंक्शन, दी गई रेंज में कॉलम को दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This unhides the first column if it was previously hidden
const range = sheet.getRange('A1');
sheet.unhideColumn(range);

पैरामीटर

नामटाइपब्यौरा
columnRangeअगर रेंज छिपी हुई है, तो उसे दिखाने के लिए इस्तेमाल की जाने वाली रेंज.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

unhideRow(row)

यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्ति को दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// This unhides the first row if it was previously hidden
const range = sheet.getRange('A1');
sheet.unhideRow(range);

पैरामीटर

नामटाइपब्यौरा
rowRangeअगर रेंज छिपी हुई है, तो उसे दिखाने के लिए इस्तेमाल की जाने वाली रेंज.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

updateMenu(name, subMenus)

addMenu(name, subMenus) से जोड़े गए मेन्यू को अपडेट करता है. यह addMenu(name, subMenus) की तरह ही काम करता है.

const ss = SpreadsheetApp.getActiveSpreadsheet();
const menuEntries = [];
menuEntries.push({name: 'Lone Menu Entry', functionName: 'function1'});
ss.updateMenu('addMenuExample', menuEntries);

पैरामीटर

नामटाइपब्यौरा
nameStringअपडेट किए जाने वाले मेन्यू का नाम.
subMenusObject[]name और functionName पैरामीटर वाले JavaScript मैप का कलेक्शन. शामिल की गई लाइब्रेरी के फ़ंक्शन इस्तेमाल किए जा सकते हैं. जैसे, Library.libFunction1.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

waitForAllDataExecutionsCompletion(timeoutInSeconds)

यह फ़ंक्शन, स्प्रेडशीट में मौजूद सभी मौजूदा एक्ज़ीक्यूशन के पूरा होने तक इंतज़ार करता है. साथ ही, तय किए गए सेकंड के बाद टाइम आउट हो जाता है. अगर टाइम आउट होने पर भी एक्ज़ीक्यूशन पूरे नहीं होते हैं, तो यह फ़ंक्शन एक अपवाद दिखाता है. हालांकि, यह डेटा एक्ज़ीक्यूशन को रद्द नहीं करता है.

पैरामीटर

नामटाइपब्यौरा
timeoutInSecondsIntegerडेटा प्रोसेस होने के लिए तय किया गया समय, सेकंड में. ज़्यादा से ज़्यादा 300 सेकंड के लिए सेट किया जा सकता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

ऐसे तरीके जो अब इस्तेमाल में नहीं हैं