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इस ऑब्जेक्ट में मौजूद डेटा को, तय किए गए कॉन्टेंट टाइप में बदले गए ब्लॉब के तौर पर दिखाता है.
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 को इमेज के तौर पर डालता है.
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)SpreadsheetSpreadsheet के एडिटर की सूची से, दिए गए उपयोगकर्ता को हटाता है.
removeEditor(user)SpreadsheetSpreadsheet के एडिटर की सूची से, दिए गए उपयोगकर्ता को हटाता है.
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)RangeA1 नोटेशन या 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)

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

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

पैरामीटर

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

वापसी का टिकट

Blob — डेटा को ब्लॉब के तौर पर दिखाया गया है.


getBandings()

इस स्प्रेडशीट में सभी बैंडिंग दिखाता है.

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getBlob()

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

वापसी का टिकट

Blob — डेटा को ब्लॉब के तौर पर दिखाया गया है.


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 और (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");

पैरामीटर

नामटाइपब्यौरा
a1NotationStringA1 नोटेशन या R1C1 नोटेशन में बताई गई रेंज.

वापसी का टिकट

Range — चुनी गई जगह पर रेंज

अनुमति देना

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

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

getRangeByName(name)

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

// Log the number of columns for the range named 'TaxRates' in the active spreadsheet.
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 — टाइम ज़ोन, "लंबे" फ़ॉर्मैट में दिया गया है. उदाहरण के लिए, "America/New_York", जैसा कि Joda.org ने बताया है.

अनुमति देना

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

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

getUrl()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getViewers()

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

वापसी का टिकट

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

अनुमति देना

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

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

hideColumn(column)

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

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

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

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

पैरामीटर

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

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

दस्तावेज़ में किसी पंक्ति और कॉलम में, पिक्सल ऑफ़सेट के साथ Spreadsheet को इमेज के तौर पर डालता है. इमेज का साइज़, ब्लॉब के कॉन्टेंट से लिया जाता है. BLOB का साइज़ ज़्यादा से ज़्यादा 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यह ब्लॉब, इमेज का कॉन्टेंट, 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);

पैरामीटर

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