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)SpreadsheetSpreadsheet के लिए, एडिटर की सूची में उपयोगकर्ताओं के दिए गए अरे को जोड़ता है.
addMenu(name, subMenus)voidस्प्रेडशीट यूज़र इंटरफ़ेस (यूआई) में नया मेन्यू बनाता है.
addViewer(emailAddress)Spreadsheetदिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ता है.
addViewer(user)Spreadsheetदिए गए उपयोगकर्ता को Spreadsheet के दर्शकों की सूची में जोड़ता है.
addViewers(emailAddresses)SpreadsheetSpreadsheet के लिए, उपयोगकर्ताओं की दी गई अरे को दर्शकों की सूची में जोड़ता है.
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इस ऑब्जेक्ट के अंदर का डेटा, बताए गए कॉन्टेंट टाइप में बदले गए BLOB के तौर पर दिखाएं.
getBandings()Banding[]इस स्प्रेडशीट में सभी बैंडिंग दिखाता है.
getBlob()Blobइस ऑब्जेक्ट के अंदर के डेटा को ब्लॉब के तौर पर दिखाएं.
getColumnWidth(columnPosition)Integerदिए गए कॉलम की चौड़ाई को पिक्सल में लेता है.
getCurrentCell()Rangeयह फ़ंक्शन ऐक्टिव शीट में मौजूदा सेल को दिखाता है. अगर कोई मौजूदा सेल नहीं है, तो 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)RangeA1 संकेतन या R1C1 संकेतन में तय की गई श्रेणी देता है.
getRangeByName(name)Rangeनाम वाली रेंज दिखाता है. अगर दिए गए नाम वाली कोई रेंज नहीं मिलती है, तो यह वैल्यू null दिखाता है.
getRangeList(a1Notations)RangeListयह फ़ंक्शन RangeList कलेक्शन दिखाता है, जो एक ही शीट में मौजूद रेंज को दिखाता है A1 संकेतन या R1C1 संकेतन की गैर-खाली सूची के अनुसार बनाएं.
getRecalculationInterval()RecalculationIntervalइस स्प्रेडशीट के लिए कैलकुलेशन इंटरवल दिखाता है.
getRowHeight(rowPosition)Integerदी गई लाइन की ऊंचाई पिक्सल में हासिल करता है.
getSelection()Selectionयह स्प्रेडशीट में मौजूदा Selection दिखाता है.
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 को शामिल करता है. Pixel ऑफ़सेट के हिसाब से.
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() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var menuEntries = [];
  // When the user clicks on "addMenuExample" then "Menu Entry 1", the function function1 is
  // executed.
  menuEntries.push({name: "Menu Entry 1", functionName: "function1"});
  menuEntries.push(null); // line separator
  menuEntries.push({name: "Menu Entry 2", functionName: "function2"});

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

पैरामीटर

नामटाइपब्यौरा
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)

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

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

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

पैरामीटर

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

वापसी का टिकट

Sheet — यह शीट, तरीके की चेन बनाने के लिए काम की है.

अनुमति देना

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

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

autoResizeColumn(columnPosition)

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

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

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

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

पैरामीटर

नामटाइपब्यौरा
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
var 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)

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

var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();

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

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

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

पैरामीटर

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

वापसी का टिकट

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


deleteActiveSheet()

मौजूदा चालू शीट को मिटाता है.

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

वापसी का टिकट

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

अनुमति देना

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

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

deleteColumn(columnPosition)

कॉलम की दी गई पोज़िशन से कॉलम मिटाता है.

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

deleteColumns(columnPosition, howMany)

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

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

पैरामीटर

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

अनुमति देना

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

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

deleteRow(rowPosition)

दी गई पंक्ति की जगह से पंक्ति को मिटाता है.

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

पैरामीटर

नामटाइपब्यौरा
rowPositionIntegerपहली पंक्ति के लिए 1 से शुरू करते हुए, पंक्ति की स्थिति.

वापसी का टिकट

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

अनुमति देना

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

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

deleteRows(rowPosition, howMany)

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

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

पैरामीटर

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

अनुमति देना

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

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

deleteSheet(sheet)

चुनी गई शीट को मिटाता है.

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

पैरामीटर

नामटाइपब्यौरा
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() का इस्तेमाल करें, जो सर्च क्वेरी के मुताबिक हाइलाइट किया गया सेल.

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

वापसी का टिकट

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

अनुमति देना

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

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

getActiveRange()

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

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


getActiveRangeList()

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

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

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

वापसी का टिकट

RangeList — चालू रेंज की सूची

अनुमति देना

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

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

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


getActiveSheet()

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

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

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

वापसी का टिकट

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


getAs(contentType)

इस ऑब्जेक्ट के अंदर का डेटा, बताए गए कॉन्टेंट टाइप में बदले गए BLOB के तौर पर दिखाएं. यह तरीका, फ़ाइल नाम में सही एक्सटेंशन जोड़ देता है—उदाहरण के लिए, "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 — 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)

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

var ss = SpreadsheetApp.getActiveSpreadsheet();
var 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 दिखाता है. कॉन्टेंट बनाने मौजूदा सेल, Google Sheets के यूज़र इंटरफ़ेस (यूआई) में फ़ोकस करने वाली सेल है. साथ ही, इसे गहरे रंग से हाइलाइट किया गया है बॉर्डर. वर्तमान सेल में कभी भी एक से ज़्यादा सेल नहीं हो सकते. जब कोई उपयोगकर्ता एक या उससे ज़्यादा सेल रेंज चुनता है, चुने गए में से एक सेल मौजूदा सेल है.

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

वापसी का टिकट

Range — मौजूदा सेल

अनुमति देना

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

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

getDataRange()

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

यह फ़ंक्शनल तौर पर, A1 और A1 से जुड़ी रेंज बनाने के बराबर है (Sheet.getLastColumn(), Sheet.getLastRow()).

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

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

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

वापसी का टिकट

Range — ऐसी रेंज जिसमें स्प्रेडशीट का सारा डेटा मौजूद है

अनुमति देना

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

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

getDataSourceFormulas()

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

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

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

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

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

वापसी का टिकट

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

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getFrozenRows()

फ़्रीज़ की गई पंक्तियों की संख्या दिखाता है.

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

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

वापसी का टिकट

Integer — फ़्रीज़ की गई पंक्तियों की संख्या

अनुमति देना

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

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

getId()

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

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

वापसी का टिकट

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


getImages()

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

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

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

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

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

वापसी का टिकट

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

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getLastRow()

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getMaxIterativeCalculationCycles()

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

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

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

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

वापसी का टिकट

Integer — कैलकुलेशन बार-बार करने की ज़्यादा से ज़्यादा संख्या.

अनुमति देना

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

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

getName()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getNamedRanges()

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

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

वापसी का टिकट

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 दिखाता है.

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

वापसी का टिकट

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

अनुमति देना

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

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

getPredefinedSpreadsheetThemes()

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

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

वापसी का टिकट

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.
var ss = SpreadsheetApp.getActive();
var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE);
for (var i = 0; i < protections.length; i++) {
  var protection = protections[i];
  if (protection.canEdit()) {
    protection.remove();
  }
}
// Remove all sheet protections in the spreadsheet that the user has permission to edit.
var ss = SpreadsheetApp.getActive();
var protections = ss.getProtections(SpreadsheetApp.ProtectionType.SHEET);
for (var i = 0; i < protections.length; i++) {
  var protection = protections[i];
  if (protection.canEdit()) {
    protection.remove();
  }
}

पैरामीटर

नामटाइपब्यौरा
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"
var ss = SpreadsheetApp.getActiveSpreadsheet();
var range = ss.getRange("Invoices!A1:D4");

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

पैरामीटर

नामटाइपब्यौरा
a1NotationStringदी जाने वाली रेंज, जैसा कि A1 नोटेशन या R1C1 नोटेशन में बताया गया है.

वापसी का टिकट

Range — तय जगह की रेंज

अनुमति देना

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

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

getRangeByName(name)

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

// Log the number of columns for the range named 'TaxRates' in the active spreadsheet.
var 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.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var 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)

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

var ss = SpreadsheetApp.getActiveSpreadsheet();
var 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 दिखाता है.

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

वापसी का टिकट

Selection — फ़िलहाल चुना गया

अनुमति देना

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

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

getSheetByName(name)

दिए गए नाम के साथ शीट दिखाता है.

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

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

पैरामीटर

नामटाइपब्यौरा
nameStringमिलने वाली शीट का नाम.

वापसी का टिकट

Sheet — दिए गए नाम वाली शीट.


getSheetId()

इस ऑब्जेक्ट से दिखाई जाने वाली शीट का आईडी दिखाता है.

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

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

Logger.log(sheet.getSheetId());

वापसी का टिकट

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

अनुमति देना

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

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

getSheetName()

शीट का नाम दिखाता है.

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

Logger.log(sheet.getSheetName());

वापसी का टिकट

String — शीट का नाम

अनुमति देना

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

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

getSheetValues(startRow, startColumn, numRows, numColumns)

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

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

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

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

पैरामीटर

नामटाइपब्यौरा
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
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
if (sheets.length > 1) {
  Logger.log(sheets[1].getName());
}

वापसी का टिकट

Sheet[] — स्प्रेडशीट में सभी शीट का कलेक्शन.


getSpreadsheetLocale()

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

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getSpreadsheetTheme()

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

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

वापसी का टिकट

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 — टाइम ज़ोन, "लॉन्ग" में बताया गया है फ़ॉर्मैट (उदाहरण के लिए, "अमेरिका/New_York", जैसा कि सूची में बताया गया है Joda.org से)).

अनुमति देना

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

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

getUrl()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getViewers()

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

वापसी का टिकट

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

अनुमति देना

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

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

hideColumn(column)

दी गई रेंज में कॉलम या कॉलम छिपाता है.

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

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

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

पैरामीटर

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

अनुमति देना

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

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

hideRow(row)

दी गई रेंज में पंक्तियां छिपाता है.

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

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

पैरामीटर

नामटाइपब्यौरा
rowRangeपंक्तियों की वह रेंज जिसे छिपाना है.

अनुमति देना

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

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

insertColumnAfter(afterPosition)

दी गई कॉलम की पोज़िशन के बाद, कॉलम शामिल करता है.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertColumnBefore(beforePosition)

कॉलम की दी गई पोज़िशन से पहले, कॉलम को शामिल करता है.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertColumnsAfter(afterPosition, howMany)

कॉलम की दी गई जगह के बाद, दी गई संख्या को शामिल करता है.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertColumnsBefore(beforePosition, howMany)

दी गई कॉलम की जगह से पहले कई कॉलम शामिल करता है.

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

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

पैरामीटर

नामटाइपब्यौरा
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 एमबी हो सकता है.

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

var blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName');
sheet.insertImage(blob, 1, 1);

पैरामीटर

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

वापसी का टिकट

OverGridImage — शामिल की गई इमेज.

अनुमति देना

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

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

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

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

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

var blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName');
sheet.insertImage(blob, 1, 1, 10, 10);

पैरामीटर

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

वापसी का टिकट

OverGridImage — शामिल की गई इमेज.

अनुमति देना

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

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

insertImage(url, column, row)

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

यूआरएल ऐसा होना चाहिए जिसे कोई भी ऐक्सेस कर सके.

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

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

पैरामीटर

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

वापसी का टिकट

OverGridImage — शामिल की गई इमेज.

अनुमति देना

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

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

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

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

यूआरएल ऐसा होना चाहिए जिसे कोई भी ऐक्सेस कर सके.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRowAfter(afterPosition)

दी गई पंक्ति की जगह के बाद एक पंक्ति शामिल करता है.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRowBefore(beforePosition)

दी गई पंक्ति की जगह से पहले पंक्ति शामिल करता है.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRowsAfter(afterPosition, howMany)

दी गई पंक्ति की जगह के बाद कई पंक्तियां शामिल करता है.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRowsBefore(beforePosition, howMany)

दी गई पंक्ति की जगह से पहले कई पंक्तियां शामिल करता है.

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertSheet()

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

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

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

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

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

insertSheet(sheetIndex)

दिए गए इंडेक्स पर स्प्रेडशीट में नई शीट शामिल करता है. नई शीट चालू हो जाती है शीट.

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

पैरामीटर

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

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

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

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

insertSheet(sheetIndex, options)

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

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

पैरामीटर

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

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

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

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

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

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

insertSheet(options)

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

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

पैरामीटर

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

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

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

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

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

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

insertSheet(sheetName)

दिए गए नाम के साथ स्प्रेडशीट में एक नई शीट सम्मिलित करता है. नई शीट चालू हो जाती है शीट.

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

पैरामीटर

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

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

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

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

insertSheet(sheetName, sheetIndex)

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

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

पैरामीटर

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

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

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

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

insertSheet(sheetName, sheetIndex, options)

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

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

पैरामीटर

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

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

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

वापसी का टिकट

Sheet — नई शीट.

अनुमति देना

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

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

insertSheet(sheetName, options)

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

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

पैरामीटर

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

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

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

वापसी का टिकट

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)

यह जानकारी दिखाता है कि दिए गए कॉलम को उपयोगकर्ता ने छिपाया है या नहीं.

var ss = SpreadsheetApp.getActiveSpreadsheet();
var 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)

यह बताता है कि दी गई पंक्ति, फ़िल्टर व्यू के ज़रिए छिपी हुई है या नहीं.

var ss = SpreadsheetApp.getActiveSpreadsheet();
var 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)

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

var ss = SpreadsheetApp.getActiveSpreadsheet();
var 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.
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
// Gets the "first" sheet and activates it.
var sheet = spreadsheet.getSheetByName("first").activate();

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

spreadsheet.moveActiveSheet(2);

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

पैरामीटर

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

अनुमति देना

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

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

moveChartToObjectSheet(chart)

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

var sheet = SpreadsheetApp.getActiveSheet();
var chart = sheet.newChart().setPosition(1, 1, 0, 0).build();
sheet.insertChart(chart);
var 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() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  ss.addMenu("badMenu", [{name: "remove bad menu", functionName: "removeBadMenu"},
                                       {name: "foo", functionName: "foo"}]);
}
function removeBadMenu() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  ss.removeMenu("badMenu");  // name must match the name used when added the menu
}
function foo(){
// Do nothing
}

पैरामीटर

नामटाइपब्यौरा
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.
var 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 — चेन बनाने के लिए यह Spreadsheet.

अनुमति देना

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

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

removeViewer(user)

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

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

पैरामीटर

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

वापसी का टिकट

Spreadsheet — चेन बनाने के लिए यह Spreadsheet.

अनुमति देना

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

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

rename(newName)

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

var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.rename("This is the new name");

पैरामीटर

नामटाइपब्यौरा
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 वाली रेंज में सबसे ऊपर का बायां सेल.

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

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

पैरामीटर

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

वापसी का टिकट

Range — नई चालू रेंज

अनुमति देना

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

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

setActiveRangeList(rangeList)

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setActiveSelection(range)

इस शीट के लिए, चुने गए सक्रिय क्षेत्र को सेट करता है.

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

var range = sheet.getRange("A1:D4");
sheet.setActiveSelection(range);

पैरामीटर

नामटाइपब्यौरा
rangeRangeवह रेंज जिसे फ़िलहाल चुनी गई रेंज के तौर पर सेट करना है.

वापसी का टिकट

Range — नई चालू रेंज

अनुमति देना

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

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

setActiveSelection(a1Notation)

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

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

sheet.setActiveSelection("A1:D4");

पैरामीटर

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

वापसी का टिकट

Range — नई चालू रेंज

अनुमति देना

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

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

setActiveSheet(sheet)

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

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

पैरामीटर

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

वापसी का टिकट

Sheet — ऐक्टिव शीट.

अनुमति देना

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

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

setActiveSheet(sheet, restoreSelection)

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

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setColumnWidth(columnPosition, width)

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setCurrentCell(cell)

चुने गए सेल को current cell के रूप में सेट करता है.

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

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

ध्यान दें: दिए गए Range में एक सेल होना चाहिए, नहीं तो यह अपवाद.

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

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

पैरामीटर

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

वापसी का टिकट

Range — नया सेट किया गया मौजूदा सेल

अनुमति देना

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

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

setFrozenColumns(columns)

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

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

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

पैरामीटर

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

अनुमति देना

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

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

setFrozenRows(rows)

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

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

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

पैरामीटर

नामटाइपब्यौरा
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
var 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) का इस्तेमाल करें.

var ss = SpreadsheetApp.getActiveSpreadsheet();
var 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)

स्प्रेडशीट पर कोई थीम सेट करता है.

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

पैरामीटर

नामटाइपब्यौरा
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समय क्षेत्र, "लंबे" में बताया गया है फ़ॉर्मैट (उदाहरण के लिए, "America/New_York", जैसा Joda.org से लिया गया है).

अनुमति देना

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

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

show(userInterface)

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

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

नीचे दिया गया कोड स्निपेट,HtmlService दर्ज किया गया शीर्षक, ऊंचाई, और चौड़ाई:

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

SpreadsheetApp.getActiveSpreadsheet().show(htmlApp);

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

पैरामीटर

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

अनुमति देना

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

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

sort(columnPosition)

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

sort(columnPosition, ascending)

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

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

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

पैरामीटर

नामटाइपब्यौरा
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 है, तो टोस्ट की डिफ़ॉल्ट वैल्यू 5 सेकंड होगी; अगर नेगेटिव है, तो टोस्ट खारिज होने तक बना रहता है.

अनुमति देना

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

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

unhideColumn(column)

दी गई रेंज में कॉलम दिखाता है.

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

// This unhides the first column if it was previously hidden
var range = sheet.getRange("A1");
sheet.unhideColumn(range);

पैरामीटर

नामटाइपब्यौरा
columnRangeदिखाई जाने वाली रेंज, अगर छिपी हुई है, तो.

अनुमति देना

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

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

unhideRow(row)

दी गई रेंज में पंक्ति दिखाता है.

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

// This unhides the first row if it was previously hidden
var range = sheet.getRange("A1");
sheet.unhideRow(range);

पैरामीटर

नामटाइपब्यौरा
rowRangeदिखाई जाने वाली रेंज, अगर छिपी हुई है, तो.

अनुमति देना

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

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

updateMenu(name, subMenus)

addMenu(name, subMenus) ने जो मेन्यू जोड़ा है उसे अपडेट करता है. बिलकुल addMenu(name, subMenus) की तरह काम करता है.

var ss = SpreadsheetApp.getActiveSpreadsheet();
var 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

ऐसे तरीके जो अब काम नहीं करते