Class Sheet

शीट

स्प्रेडशीट की शीट को ऐक्सेस और उनमें बदलाव करना. शीट का नाम बदलना और शीट से रेंज ऑब्जेक्ट ऐक्सेस करना, सामान्य कार्रवाइयां हैं.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
activate()Sheetइस शीट को चालू करता है.
addDeveloperMetadata(key)Sheetयह फ़ंक्शन, शीट में दी गई कुंजी के साथ डेवलपर मेटाडेटा जोड़ता है.
addDeveloperMetadata(key, visibility)Sheetयह फ़ंक्शन, शीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और दिखने की सेटिंग होती है.
addDeveloperMetadata(key, value)Sheetयह फ़ंक्शन, शीट में दी गई कुंजी और वैल्यू के साथ डेवलपर मेटाडेटा जोड़ता है.
addDeveloperMetadata(key, value, visibility)Sheetयह फ़ंक्शन, शीट में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी, वैल्यू, और दिखने की सेटिंग शामिल होती है.
appendRow(rowContents)Sheetयह फ़ंक्शन, शीट में मौजूद मौजूदा डेटा क्षेत्र की सबसे नीचे वाली पंक्ति में एक नई पंक्ति जोड़ता है.
asDataSourceSheet()DataSourceSheetअगर शीट का टाइप SheetType.DATASOURCE है, तो यह फ़ंक्शन शीट को DataSourceSheet के तौर पर दिखाता है. अगर शीट का टाइप SheetType.DATASOURCE नहीं है, तो यह फ़ंक्शन शीट को null के तौर पर दिखाता है.
autoResizeColumn(columnPosition)Sheetयह विकल्प, दिए गए कॉलम की चौड़ाई को उसके कॉन्टेंट के हिसाब से सेट करता है.
autoResizeColumns(startColumn, numColumns)Sheetयह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले सभी कॉलम की चौड़ाई को उनके कॉन्टेंट के हिसाब से सेट करता है.
autoResizeRows(startRow, numRows)Sheetयह विकल्प, दी गई पंक्ति की पोज़िशन से शुरू होने वाली सभी पंक्तियों की ऊंचाई को उनके कॉन्टेंट के हिसाब से सेट करता है.
clear()Sheetइस विकल्प को चुनने पर, शीट में मौजूद कॉन्टेंट और फ़ॉर्मैटिंग की जानकारी मिट जाती है.
clear(options)Sheetयह फ़ंक्शन, दिए गए ऐडवांस विकल्पों के हिसाब से कॉन्टेंट और/या फ़ॉर्मैट वाली शीट को मिटाता है.
clearConditionalFormatRules()voidइस फ़ंक्शन की मदद से, शीट से शर्त के साथ फ़ॉर्मैटिंग के सभी नियम हटाए जाते हैं.
clearContents()Sheetयह कुकी, कॉन्टेंट वाली शीट को मिटा देती है. हालांकि, फ़ॉर्मैटिंग की जानकारी को सेव रखती है.
clearFormats()Sheetइससे कॉन्टेंट को सुरक्षित रखते हुए, शीट की फ़ॉर्मैटिंग मिट जाती है.
clearNotes()Sheetइस विकल्प से, शीट में मौजूद सभी नोट मिट जाते हैं.
collapseAllColumnGroups()Sheetइससे शीट पर मौजूद सभी कॉलम ग्रुप छोटे हो जाते हैं.
collapseAllRowGroups()Sheetइससे शीट पर मौजूद पंक्तियों के सभी ग्रुप छोटे हो जाते हैं.
copyTo(spreadsheet)Sheetयह फ़ंक्शन, शीट को दी गई स्प्रेडशीट में कॉपी करता है. यह सोर्स शीट वाली स्प्रेडशीट भी हो सकती है.
createDeveloperMetadataFinder()DeveloperMetadataFinderयह फ़ंक्शन, इस शीट के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए DeveloperMetadataFinder दिखाता है.
createTextFinder(findText)TextFinderयह फ़ंक्शन, शीट के लिए टेक्स्ट फ़ाइंडर बनाता है. इसकी मदद से, शीट में टेक्स्ट को खोजा और बदला जा सकता है.
deleteColumn(columnPosition)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन पर मौजूद कॉलम को मिटाता है.
deleteColumns(columnPosition, howMany)voidयह फ़ंक्शन, दी गई कॉलम पोज़िशन से शुरू होने वाले कॉलम की संख्या को मिटाता है.
deleteRow(rowPosition)Sheetलाइन की दी गई जगह पर मौजूद लाइन को मिटाता है.
deleteRows(rowPosition, howMany)voidइससे, दी गई लाइन की पोज़िशन से शुरू होने वाली लाइनों की संख्या मिट जाती है.
expandAllColumnGroups()Sheetइससे शीट पर मौजूद सभी कॉलम ग्रुप बड़े हो जाते हैं.
expandAllRowGroups()Sheetइससे शीट पर मौजूद सभी लाइन ग्रुप बड़े हो जाते हैं.
expandColumnGroupsUpToDepth(groupDepth)Sheetयह विकल्प, दिए गए डेप्थ तक के सभी कॉलम ग्रुप को बड़ा करता है और बाकी सभी को छोटा करता है.
expandRowGroupsUpToDepth(groupDepth)Sheetइससे सभी लाइन ग्रुप को तय की गई डेप्थ तक बड़ा किया जाता है और बाकी सभी को छोटा किया जाता है.
getActiveCell()Rangeइस शीट में मौजूद ऐक्टिव सेल की जानकारी दिखाता है.
getActiveRange()Rangeयह फ़ंक्शन, चालू शीट में चुनी गई रेंज दिखाता है. अगर कोई रेंज चालू नहीं है, तो यह null दिखाता है.
getActiveRangeList()RangeListयह फ़ंक्शन, ऐक्टिव शीट में मौजूद ऐक्टिव रेंज की सूची दिखाता है. अगर कोई ऐक्टिव रेंज मौजूद नहीं है, तो यह null दिखाता है.
getBandings()Banding[]इस शीट में मौजूद सभी बैंडिंग दिखाता है.
getCharts()EmbeddedChart[]यह फ़ंक्शन, इस शीट पर मौजूद चार्ट का कलेक्शन दिखाता है.
getColumnGroup(columnIndex, groupDepth)Groupयह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद कॉलम ग्रुप दिखाता है.
getColumnGroupControlPosition()GroupControlTogglePositionयह फ़ंक्शन, शीट पर मौजूद सभी कॉलम ग्रुप के लिए GroupControlTogglePosition दिखाता है.
getColumnGroupDepth(columnIndex)Integerयह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम की ग्रुप डेप्थ दिखाता है.
getColumnWidth(columnPosition)Integerइस फ़ंक्शन से, दी गई कॉलम की चौड़ाई पिक्सल में मिलती है.
getConditionalFormatRules()ConditionalFormatRule[]इस शीट में, शर्त के साथ फ़ॉर्मैटिंग के सभी नियम पाएं.
getCurrentCell()Rangeयह फ़ंक्शन, ऐक्टिव शीट में मौजूद मौजूदा सेल या null दिखाता है. अगर कोई मौजूदा सेल नहीं है, तो यह null दिखाता है.
getDataRange()Rangeयह फ़ंक्शन, उन डाइमेंशन के लिए Range दिखाता है जिनमें डेटा मौजूद है.
getDataSourceFormulas()DataSourceFormula[]इससे डेटा सोर्स के सभी फ़ॉर्मूले मिलते हैं.
getDataSourcePivotTables()DataSourcePivotTable[]इससे डेटा सोर्स की सभी पिवट टेबल मिलती हैं.
getDataSourceTables()DataSourceTable[]इससे डेटा सोर्स की सभी टेबल मिलती हैं.
getDeveloperMetadata()DeveloperMetadata[]इस शीट से जुड़ा डेवलपर का सारा मेटाडेटा पाएं.
getDrawings()Drawing[]यह फ़ंक्शन, शीट पर मौजूद ड्रॉइंग का अरे दिखाता है.
getFilter()Filterइस शीट में मौजूद फ़िल्टर दिखाता है. अगर कोई फ़िल्टर नहीं है, तो null दिखाता है.
getFormUrl()Stringयह फ़ंक्शन, उस फ़ॉर्म का यूआरएल दिखाता है जो इस शीट में जवाब भेजता है. अगर इस शीट से कोई फ़ॉर्म नहीं जुड़ा है, तो यह null दिखाता है.
getFrozenColumns()Integerफ़्रीज़ किए गए कॉलम की संख्या दिखाता है.
getFrozenRows()Integerइस फ़ंक्शन की मदद से, फ़्रीज़ की गई पंक्तियों की संख्या मिलती है.
getImages()OverGridImage[]यह फ़ंक्शन, शीट पर मौजूद सभी ओवर-द-ग्रिड इमेज दिखाता है.
getIndex()Integerयह फ़ंक्शन, पैरंट स्प्रेडशीट में शीट की पोज़िशन दिखाता है.
getLastColumn()Integerयह फ़ंक्शन, कॉन्टेंट वाले आखिरी कॉलम की पोज़िशन दिखाता है.
getLastRow()Integerकॉन्टेंट वाली आखिरी लाइन की पोज़िशन दिखाता है.
getMaxColumns()Integerयह फ़ंक्शन, शीट में मौजूद कॉलम की मौजूदा संख्या दिखाता है. भले ही, उनमें कोई कॉन्टेंट मौजूद हो या न हो.
getMaxRows()Integerयह फ़ंक्शन, कॉन्टेंट के बावजूद शीट में मौजूद पंक्तियों की मौजूदा संख्या दिखाता है.
getName()Stringशीट का नाम दिखाता है.
getNamedRanges()NamedRange[]इस शीट में मौजूद सभी नामित श्रेणियों को दिखाता है.
getParent()Spreadsheetइस शीट को शामिल करने वाला Spreadsheet दिखाता है.
getPivotTables()PivotTable[]इस शीट पर मौजूद सभी पिवट टेबल दिखाता है.
getProtections(type)Protection[]यह फ़ंक्शन, शीट में सुरक्षित की गई सभी रेंज को दिखाने वाले ऑब्जेक्ट का कलेक्शन या शीट की सुरक्षा को दिखाने वाले सिंगल-एलिमेंट का कलेक्शन दिखाता है.
getRange(row, column)Rangeयह फ़ंक्शन, दिए गए निर्देशांकों के हिसाब से सबसे ऊपर मौजूद बाएं सेल वाली रेंज दिखाता है.
getRange(row, column, numRows)Rangeयह फ़ंक्शन, दिए गए निर्देशांकों पर सबसे ऊपर मौजूद बाएं सेल वाली रेंज दिखाता है. साथ ही, इसमें पंक्तियों की दी गई संख्या होती है.
getRange(row, column, numRows, numColumns)Rangeयह फ़ंक्शन, दिए गए निर्देशांकों पर सबसे ऊपर मौजूद बाएं सेल वाली रेंज दिखाता है. इस रेंज में पंक्तियों और कॉलम की संख्या भी दी गई होती है.
getRange(a1Notation)Rangeयह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताई गई रेंज दिखाता है.
getRangeList(a1Notations)RangeListयह फ़ंक्शन, उसी शीट में मौजूद उन रेंज का RangeList कलेक्शन दिखाता है जिन्हें A1 नोटेशन या R1C1 नोटेशन की ऐसी सूची से तय किया गया है जिसमें कोई वैल्यू मौजूद है.
getRowGroup(rowIndex, groupDepth)Groupयह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद पंक्ति ग्रुप दिखाता है.
getRowGroupControlPosition()GroupControlTogglePositionयह फ़ंक्शन, शीट पर मौजूद सभी लाइन ग्रुप के लिए GroupControlTogglePosition दिखाता है.
getRowGroupDepth(rowIndex)Integerयह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद लाइन की ग्रुप डेप्थ दिखाता है.
getRowHeight(rowPosition)Integerइस तरीके से, दी गई लाइन की ऊंचाई पिक्सल में मिलती है.
getSelection()Selectionयह फ़ंक्शन, स्प्रेडशीट में मौजूद मौजूदा Selection दिखाता है.
getSheetId()Integerयह फ़ंक्शन, इस ऑब्जेक्ट से जुड़ी शीट का आईडी दिखाता है.
getSheetName()Stringयह फ़ंक्शन, शीट का नाम दिखाता है.
getSheetValues(startRow, startColumn, numRows, numColumns)Object[][]यह फ़ंक्शन, दिए गए कोऑर्डिनेट से शुरू होने वाली इस रेंज के लिए, वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है.
getSlicers()Slicer[]यह फ़ंक्शन, शीट पर मौजूद स्लाइसर की एक अरे दिखाता है.
getTabColorObject()Colorयह शीट टैब का रंग दिखाता है. अगर शीट टैब का कोई रंग नहीं है, तो null दिखाता है.
getType()SheetTypeशीट का टाइप दिखाता है.
hasHiddenGridlines()Booleanअगर शीट की ग्रिडलाइन छिपी हुई हैं, तो true दिखाता है. ऐसा न होने पर, false दिखाता है.
hideColumn(column)voidयह फ़ंक्शन, दी गई रेंज में मौजूद कॉलम को छिपाता है.
hideColumns(columnIndex)voidयह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम को छिपाता है.
hideColumns(columnIndex, numColumns)voidयह फ़ंक्शन, दिए गए इंडेक्स से शुरू होने वाले एक या उससे ज़्यादा कॉलम को छिपाता है.
hideRow(row)voidयह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों को छिपाता है.
hideRows(rowIndex)voidदिए गए इंडेक्स पर मौजूद लाइन को छिपाता है.
hideRows(rowIndex, numRows)voidइस फ़ंक्शन की मदद से, दिए गए इंडेक्स से शुरू होने वाली एक या उससे ज़्यादा लगातार पंक्तियों को छिपाया जा सकता है.
hideSheet()Sheetइस शीट को छिपाता है.
insertChart(chart)voidइस शीट में एक नया चार्ट जोड़ता है.
insertColumnAfter(afterPosition)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद एक कॉलम जोड़ता है.
insertColumnBefore(beforePosition)Sheetयह फ़ंक्शन, दी गई कॉलम की पोज़िशन से पहले एक कॉलम जोड़ता है.
insertColumns(columnIndex)voidयह फ़ंक्शन, शीट में बताई गई जगह पर एक खाली कॉलम जोड़ता है.
insertColumns(columnIndex, numColumns)voidयह फ़ंक्शन, तय की गई जगह से शुरू करके, शीट में एक या उससे ज़्यादा लगातार खाली कॉलम जोड़ता है.
insertColumnsAfter(afterPosition, howMany)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन के बाद, तय किए गए कॉलम की संख्या को जोड़ता है.
insertColumnsBefore(beforePosition, howMany)Sheetयह फ़ंक्शन, कॉलम की दी गई पोज़िशन से पहले कई कॉलम जोड़ता है.
insertImage(blobSource, column, row)OverGridImageयह फ़ंक्शन, किसी दस्तावेज़ में दी गई पंक्ति और कॉलम में BlobSource को इमेज के तौर पर शामिल करता है.
insertImage(blobSource, column, row, offsetX, offsetY)OverGridImageयह फ़ंक्शन, किसी दस्तावेज़ में दी गई लाइन और कॉलम में BlobSource को इमेज के तौर पर शामिल करता है. साथ ही, पिक्सल ऑफ़सेट भी तय करता है.
insertImage(url, column, row)OverGridImageदस्तावेज़ में किसी दी गई पंक्ति और कॉलम में इमेज डालता है.
insertImage(url, column, row, offsetX, offsetY)OverGridImageयह फ़ंक्शन, दस्तावेज़ में किसी इमेज को तय की गई लाइन और कॉलम में पिक्सल ऑफ़सेट के साथ जोड़ता है.
insertRowAfter(afterPosition)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद एक पंक्ति जोड़ता है.
insertRowBefore(beforePosition)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले एक पंक्ति जोड़ता है.
insertRows(rowIndex)voidयह फ़ंक्शन, शीट में बताई गई जगह पर एक खाली लाइन जोड़ता है.
insertRows(rowIndex, numRows)voidयह फ़ंक्शन, तय की गई जगह से शुरू होने वाली शीट में, एक या उससे ज़्यादा लगातार खाली लाइनें जोड़ता है.
insertRowsAfter(afterPosition, howMany)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन के बाद कई पंक्तियां जोड़ता है.
insertRowsBefore(beforePosition, howMany)Sheetयह फ़ंक्शन, दी गई पंक्ति की पोज़िशन से पहले कई पंक्तियां जोड़ता है.
insertSlicer(range, anchorRowPos, anchorColPos)Slicerइस शीट में एक नया स्लाइसर जोड़ता है.
insertSlicer(range, anchorRowPos, anchorColPos, offsetX, offsetY)Slicerइस शीट में एक नया स्लाइसर जोड़ता है.
isColumnHiddenByUser(columnPosition)Booleanयह फ़ंक्शन बताता है कि उपयोगकर्ता ने दी गई कॉलम को छिपाया है या नहीं.
isRightToLeft()Booleanअगर इस शीट का लेआउट दाएं से बाएं है, तो true दिखाता है.
isRowHiddenByFilter(rowPosition)Booleanयह फ़ंक्शन बताता है कि दी गई लाइन को फ़िल्टर (फ़िल्टर व्यू नहीं) की मदद से छिपाया गया है या नहीं.
isRowHiddenByUser(rowPosition)Booleanइससे यह पता चलता है कि दी गई लाइन को उपयोगकर्ता ने छिपाया है या नहीं.
isSheetHidden()Booleanअगर शीट अभी छिपी हुई है, तो यह फ़ंक्शन true दिखाता है.
moveColumns(columnSpec, destinationIndex)voidयह फ़ंक्शन, दी गई रेंज से चुने गए कॉलम को destinationIndex से दिखाई गई जगह पर ले जाता है.
moveRows(rowSpec, destinationIndex)voidइस फ़ंक्शन की मदद से, दी गई रेंज में चुनी गई लाइनों को destinationIndex से दिखाई गई जगह पर ले जाया जाता है.
newChart()EmbeddedChartBuilderयह फ़ंक्शन, इस शीट के लिए नया चार्ट बनाने के लिए बिल्डर दिखाता है.
protect()Protectionयह एक ऐसा ऑब्जेक्ट बनाता है जो शीट को उन उपयोगकर्ताओं के अलावा किसी और से सुरक्षित रख सकता है जिनके पास अनुमति है.
removeChart(chart)voidइस फ़ंक्शन का इस्तेमाल करके, पैरंट शीट से किसी चार्ट को हटाया जा सकता है.
setActiveRange(range)Rangeयह फ़ंक्शन, चुनी गई रेंज को चालू शीट में active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर मौजूद बाएं सेल को current cell के तौर पर सेट करता है.
setActiveRangeList(rangeList)RangeListयह फ़ंक्शन, रेंज की दी गई सूची को ऐक्टिव शीट में active ranges के तौर पर सेट करता है.
setActiveSelection(range)Rangeइस शीट के लिए, चुने गए सेल की रेंज सेट करता है.
setActiveSelection(a1Notation)Rangeयह फ़ंक्शन, A1 नोटेशन या R1C1 नोटेशन में बताए गए हिसाब से, ऐक्टिव सेल को सेट करता है.
setColumnGroupControlPosition(position)Sheetइस विकल्प की मदद से, शीट पर कॉलम ग्रुप कंट्रोल टॉगल की पोज़िशन सेट की जाती है.
setColumnWidth(columnPosition, width)Sheetइससे दिए गए कॉलम की चौड़ाई पिक्सल में सेट की जाती है.
setColumnWidths(startColumn, numColumns, width)Sheetइससे दिए गए कॉलम की चौड़ाई पिक्सल में सेट की जा सकती है.
setConditionalFormatRules(rules)voidयह फ़ंक्शन, शीट में मौजूद शर्त के साथ फ़ॉर्मैटिंग के सभी नियमों को, इनपुट नियमों से बदल देता है.
setCurrentCell(cell)Rangeइस फ़ंक्शन से, तय की गई सेल को current cell के तौर पर सेट किया जाता है.
setFrozenColumns(columns)voidइससे, दी गई संख्या के हिसाब से कॉलम फ़्रीज़ हो जाते हैं.
setFrozenRows(rows)voidदी गई पंक्तियों की संख्या को फ़्रीज़ करता है.
setHiddenGridlines(hideGridlines)Sheetयह शीट की ग्रिडलाइन को छिपाता या दिखाता है.
setName(name)Sheetयह कुकी, शीट का नाम सेट करती है.
setRightToLeft(rightToLeft)Sheetइस विकल्प का इस्तेमाल करके, शीट के लेआउट को दाएं से बाएं पर सेट या अनसेट किया जाता है.
setRowGroupControlPosition(position)Sheetइस विकल्प की मदद से, शीट पर लाइन ग्रुप कंट्रोल टॉगल की पोज़िशन सेट की जाती है.
setRowHeight(rowPosition, height)Sheetयह विकल्प, दी गई लाइन की ऊंचाई को पिक्सल में सेट करता है.
setRowHeights(startRow, numRows, height)Sheetइससे दी गई पंक्तियों की ऊंचाई पिक्सल में सेट की जाती है.
setRowHeightsForced(startRow, numRows, height)Sheetइससे दी गई पंक्तियों की ऊंचाई पिक्सल में सेट की जाती है.
setTabColor(color)Sheetशीट टैब का रंग सेट करता है.
setTabColorObject(color)Sheetशीट टैब का रंग सेट करता है.
showColumns(columnIndex)voidयह फ़ंक्शन, दिए गए इंडेक्स पर मौजूद कॉलम को दिखाता है.
showColumns(columnIndex, numColumns)voidयह फ़ंक्शन, दिए गए इंडेक्स से शुरू होने वाले एक या उससे ज़्यादा कॉलम को दिखाता है.
showRows(rowIndex)voidइस तरीके का इस्तेमाल करके, दिए गए इंडेक्स पर मौजूद लाइन को वापस दिखाया जा सकता है.
showRows(rowIndex, numRows)voidइस तरीके का इस्तेमाल करके, दिए गए इंडेक्स से शुरू होने वाली एक या उससे ज़्यादा लगातार पंक्तियों को दिखाया जा सकता है.
showSheet()Sheetइससे शीट दिखने लगती है.
sort(columnPosition)Sheetयह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से बढ़ते क्रम में लगाता है.
sort(columnPosition, ascending)Sheetयह फ़ंक्शन, किसी शीट को कॉलम के हिसाब से क्रम में लगाता है.
unhideColumn(column)voidयह फ़ंक्शन, दी गई रेंज में कॉलम को दिखाता है.
unhideRow(row)voidयह फ़ंक्शन, दी गई रेंज में मौजूद पंक्ति को दिखाता है.
updateChart(chart)voidइस शीट पर मौजूद चार्ट को अपडेट करता है.

ज़्यादा जानकारी वाला दस्तावेज़

activate()

इस शीट को चालू करता है. इससे शीट में कोई बदलाव नहीं होता. इससे सिर्फ़ पैरंट को दिखने वाली ऐक्टिव शीट बदलती है.

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.activate();

वापसी का टिकट

Sheet — हाल ही में ऐक्टिव की गई शीट.


addDeveloperMetadata(key)

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Adds the key 'NAME' to the developer metadata for the sheet. sheet.addDeveloperMetadata('NAME');  // Gets the updated metadata info and logs it to the console. console.log(sheet.getDeveloperMetadata()[0].getKey());

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

addDeveloperMetadata(key, visibility)

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Adds the key 'NAME' and sets the developer metadata visibility to PROJECT // for the sheet. sheet.addDeveloperMetadata(     'NAME',     SpreadsheetApp.DeveloperMetadataVisibility.PROJECT, );  // Gets the updated metadata info and logs it to the console. const developerMetaData = sheet.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getVisibility().toString());

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

addDeveloperMetadata(key, value)

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Adds the key 'COMPANY' with the value 'TECH' to the developer metadata for // the sheet. sheet.addDeveloperMetadata('COMPANY', 'TECH');  // Gets the updated metadata info and logs it to the console. const developerMetaData = sheet.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getValue());

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

addDeveloperMetadata(key, value, visibility)

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Adds the key 'COMPANY' with the value 'TECH' to the developer metadata and // sets the visibility to DOCUMENT for the sheet. sheet.addDeveloperMetadata(     'COMPANY',     'TECH',     SpreadsheetApp.DeveloperMetadataVisibility.DOCUMENT, );  // Gets the updated metadata info and logs it to the console. const developerMetaData = sheet.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getValue()); console.log(developerMetaData.getVisibility().toString());

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

appendRow(rowContents)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

asDataSourceSheet()

अगर शीट का टाइप SheetType.DATASOURCE है, तो यह फ़ंक्शन शीट को DataSourceSheet के तौर पर दिखाता है. अगर शीट का टाइप SheetType.DATASOURCE नहीं है, तो यह फ़ंक्शन शीट को null के तौर पर दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can useSpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets the data source sheet value if the sheet is of type // SpreadsheetApp.SheetType.DATASOURCE, otherwise this returns a null value. const dataSourceSheet = sheet.asDataSourceSheet();  // Gets the data source sheet value and logs it to the console. console.log(dataSourceSheet); console.log(sheet.getType().toString());

वापसी का टिकट

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

अनुमति देना

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

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

autoResizeColumn(columnPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  sheet.getRange('a1').setValue(     'Whenever it is a damp, drizzly November in my soul...');  // Sets the first column to a width which fits the text sheet.autoResizeColumn(1);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

autoResizeColumns(startColumn, numColumns)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sets the first 15 columns to a width that fits their text. sheet.autoResizeColumns(1, 15);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

autoResizeRows(startRow, numRows)

यह विकल्प, दी गई पंक्ति की पोज़िशन से शुरू होने वाली सभी पंक्तियों की ऊंचाई को उनके कॉन्टेंट के हिसाब से सेट करता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sets the first 15 rows to a height that fits their text. sheet.autoResizeRows(1, 15);

पैरामीटर

नामटाइपब्यौरा
startRowIntegerअपने-आप साइज़ बदलने के लिए, शुरुआती पंक्ति.
numRowsIntegerअपने-आप साइज़ बदलने वाली पंक्तियों की संख्या.

वापसी का टिकट

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

अनुमति देना

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

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

clear()

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

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clear();

वापसी का टिकट

Sheet — मिटाई गई शीट.

अनुमति देना

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

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

clear(options)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.clear({formatOnly: true, contentsOnly: true});

पैरामीटर

नामटाइपब्यौरा
optionsObjectबेहतर विकल्पों वाला JavaScript मैप. इसकी जानकारी यहां दी गई है.

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

नामटाइपब्यौरा
contentsOnlyBooleanकॉन्टेंट मिटाना है या नहीं.
formatOnlyBooleanफ़ॉर्मैट मिटाया जाए या नहीं.

वापसी का टिकट

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

अनुमति देना

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

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

clearConditionalFormatRules()

इस फ़ंक्शन की मदद से, शीट से शर्त के साथ फ़ॉर्मैटिंग के सभी नियम हटाए जाते हैं. यह setConditionalFormatRules(rules) फ़ंक्शन को कॉल करने के बराबर होता है, जिसमें इनपुट के तौर पर खाली ऐरे दिया जाता है.

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

अनुमति देना

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

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

clearContents()

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

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clearContents();

वापसी का टिकट

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

अनुमति देना

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

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

clearFormats()

इससे कॉन्टेंट को सुरक्षित रखते हुए, शीट की फ़ॉर्मैटिंग मिट जाती है.

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

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clearFormats();

वापसी का टिकट

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

अनुमति देना

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

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

clearNotes()

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

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.clearNotes();

वापसी का टिकट

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

अनुमति देना

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

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

collapseAllColumnGroups()

इससे शीट पर मौजूद सभी कॉलम ग्रुप छोटे हो जाते हैं.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // All column groups on the sheet are collapsed. sheet.collapseAllColumnGroups();

वापसी का टिकट

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

अनुमति देना

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

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

collapseAllRowGroups()

इससे शीट पर मौजूद पंक्तियों के सभी ग्रुप छोटे हो जाते हैं.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // All row groups on the sheet are collapsed. sheet.collapseAllRowGroups();

वापसी का टिकट

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

अनुमति देना

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

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

copyTo(spreadsheet)

यह फ़ंक्शन, शीट को दी गई स्प्रेडशीट में कॉपी करता है. यह सोर्स शीट वाली स्प्रेडशीट भी हो सकती है. कॉपी की गई शीट का नाम "[original name] की कॉपी" होता है.

const source = SpreadsheetApp.getActiveSpreadsheet(); const sheet = source.getSheets()[0];  const destination = SpreadsheetApp.openById('ID_GOES HERE'); sheet.copyTo(destination);

पैरामीटर

नामटाइपब्यौरा
spreadsheetSpreadsheetवह स्प्रेडशीट जिसमें इस शीट को कॉपी करना है. यह सोर्स स्प्रेडशीट भी हो सकती है.

वापसी का टिकट

Sheet — चेन बनाने के लिए नई शीट.

अनुमति देना

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

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

createDeveloperMetadataFinder()

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Adds developer metadata for testing. sheet.addDeveloperMetadata('CITY', 'PARIS');  // Creates the developer metadata finder. const metadatafinder = sheet.createDeveloperMetadataFinder();  // Finds the metadata with value 'PARIS' and displays its key in the console. console.log(metadatafinder.withValue('PARIS').find()[0].getKey());

वापसी का टिकट

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


createTextFinder(findText)

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // Creates  a text finder. const textFinder = sheet.createTextFinder('dog');  // Returns the first occurrence of 'dog' in the sheet. const firstOccurrence = textFinder.findNext();  // Replaces the last found occurrence of 'dog' with 'cat' and returns the number // of occurrences replaced. const numOccurrencesReplaced = firstOccurrence.replaceWith('cat');

पैरामीटर

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

वापसी का टिकट

TextFinder — यह शीट का TextFinder होता है.


deleteColumn(columnPosition)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

deleteColumns(columnPosition, howMany)

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

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

पैरामीटर

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

अनुमति देना

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

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

deleteRow(rowPosition)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

deleteRows(rowPosition, howMany)

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

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

पैरामीटर

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

अनुमति देना

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

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

expandAllColumnGroups()

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // All column groups on the sheet are expanded. sheet.expandAllColumnGroups();

वापसी का टिकट

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

अनुमति देना

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

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

expandAllRowGroups()

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // All row groups on the sheet are expanded. sheet.expandAllRowGroups();

वापसी का टिकट

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

अनुमति देना

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

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

expandColumnGroupsUpToDepth(groupDepth)

यह विकल्प, दिए गए डेप्थ तक के सभी कॉलम ग्रुप को बड़ा करता है और बाकी सभी को छोटा करता है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // All column groups of depth 2 and lower are expanded, and groups with depth // 3 and higher are collapsed. sheet.expandColumnGroupsUpToDepth(2);

पैरामीटर

नामटाइपब्यौरा
groupDepthIntegerकॉलम ग्रुप को किस डेप्थ तक बड़ा करना है.

वापसी का टिकट

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

अनुमति देना

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

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

expandRowGroupsUpToDepth(groupDepth)

इससे सभी लाइन ग्रुप को तय की गई डेप्थ तक बड़ा किया जाता है और बाकी सभी को छोटा किया जाता है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // All row groups of depth 2 and lower are expanded, and groups with depth // 3 and higher are collapsed. sheet.expandRowGroupsUpToDepth(2);

पैरामीटर

नामटाइपब्यौरा
groupDepthIntegerग्रुप की गहराई, जहां तक पंक्ति ग्रुप को बड़ा करना है.

वापसी का टिकट

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

अनुमति देना

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

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

getActiveCell()

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getActiveRange()

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

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


getActiveRangeList()

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

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


getBandings()

इस शीट में मौजूद सभी बैंडिंग दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets the banding info for the sheet. const bandings = sheet.getBandings();  // Gets info on the bandings' second row color and logs it to the console. for (const banding of bandings) {   console.log(banding.getSecondRowColor()); }

वापसी का टिकट

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

अनुमति देना

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

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

getCharts()

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const charts = sheet.getCharts();  for (const i in charts) {   const chart = charts[i];   // Do something with the chart }

वापसी का टिकट

EmbeddedChart[] — चार्ट का ऐरे.

अनुमति देना

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

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

getColumnGroup(columnIndex, groupDepth)

यह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद कॉलम ग्रुप दिखाता है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // Returns the group whose control index is at column 2 and has a depth of 1, or // null if the group doesn’t exist. const columnGroup = sheet.getColumnGroup(2, 1);

पैरामीटर

नामटाइपब्यौरा
columnIndexIntegerग्रुप कंट्रोल टॉगल का कॉलम इंडेक्स या ग्रुप में मौजूद कोई इंडेक्स.
groupDepthIntegerग्रुप की डेप्थ.

वापसी का टिकट

Group — कंट्रोल इंडेक्स और डेप्थ पर मौजूद कॉलम ग्रुप या अगर ग्रुप मौजूद नहीं है, तो अपवाद दिखाता है.

अनुमति देना

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

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

getColumnGroupControlPosition()

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // GroupControlTogglePosition.AFTER if the column grouping control toggle is // shown after the group. const columnGroupControlPosition = sheet.getColumnGroupControlPosition();

वापसी का टिकट

GroupControlTogglePositiontrue अगर इस शीट पर ग्रुप के बाद कॉलम ग्रुपिंग कंट्रोल टॉगल दिखाया जाता है और false ऐसा न होने पर.

अनुमति देना

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

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

getColumnGroupDepth(columnIndex)

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

ग्रुप डेप्थ से पता चलता है कि कॉलम में कितने ग्रुप ओवरलैप होते हैं. यह वैल्यू शून्य से आठ के बीच हो सकती है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // 1 if there is a group over columns 1 through 3 const groupDepth = sheet.getColumnGroupDepth(1);

पैरामीटर

नामटाइपब्यौरा
columnIndexIntegerकॉलम का इंडेक्स.

वापसी का टिकट

Integer — दिए गए इंडेक्स पर मौजूद कॉलम की ग्रुप डेप्थ.

अनुमति देना

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

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

getColumnWidth(columnPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Columns start at 1 Logger.log(sheet.getColumnWidth(1));

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getConditionalFormatRules()

इस शीट में, शर्त के साथ फ़ॉर्मैटिंग के सभी नियम पाएं.

// Logs the conditional format rules in a sheet. const rules = SpreadsheetApp.getActiveSheet().getConditionalFormatRules(); for (let i = 0; i < rules.length; i++) {   const rule = rules[i];   Logger.log(rule); }

वापसी का टिकट

ConditionalFormatRule[] — शीट में मौजूद सभी नियमों की एक ऐरे.

अनुमति देना

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

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

getCurrentCell()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getDataRange()

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

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This represents ALL the data const range = sheet.getDataRange(); const values = range.getValues();  // This logs the spreadsheet in CSV format with a trailing comma for (let i = 0; i < values.length; i++) {   let row = '';   for (let j = 0; j < values[i].length; j++) {     if (values[i][j]) {       row = row + values[i][j];     }     row = `${row},`;   }   Logger.log(row); }

वापसी का टिकट

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

अनुमति देना

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

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

getDataSourceFormulas()

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

// Opens the spreadsheet by its ID. If you created your script from within a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456');  // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets an array of the data source formulas on Sheet1. // To get an array of data source formulas for the entire spreadsheet, // replace 'sheet' with 'ss'. const dataSourceFormulas = sheet.getDataSourceFormulas();  // Logs the first data source formula in the array. console.log(dataSourceFormulas[0].getFormula());

वापसी का टिकट

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

अनुमति देना

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

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

getDataSourcePivotTables()

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

// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456');  // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets an array of the data source pivot tables on Sheet1. // To get an array of data source pivot tables for the entire // spreadsheet, replace 'sheet' with 'ss'. const dataSourcePivotTables = sheet.getDataSourcePivotTables();  // Logs the last time that the first pivot table in the array was refreshed. console.log(dataSourcePivotTables[0].getStatus().getLastRefreshedTime());

वापसी का टिकट

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

अनुमति देना

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

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

getDataSourceTables()

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

// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456');  // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets an array of data source tables on Sheet1. // To get an array of data source tables for the entire spreadsheet, // replace 'sheet' with 'ss'. const dataSourceTables = sheet.getDataSourceTables();  // Logs the last completed data execution time on the first data source table. console.log(dataSourceTables[0].getStatus().getLastExecutionTime());

वापसी का टिकट

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

अनुमति देना

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

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

getDeveloperMetadata()

इस शीट से जुड़ा डेवलपर का सारा मेटाडेटा पाएं.

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Adds developer metadata for testing. sheet.addDeveloperMetadata('CITY', 'PARIS');  // Gets all the developer metadata for the sheet. const developerMetaDataList = sheet.getDeveloperMetadata();  // Logs the developer metadata to the console. for (const developerMetaData of developerMetaDataList) {   console.log(developerMetaData.getKey()); }

वापसी का टिकट

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

अनुमति देना

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

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

getDrawings()

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets all the drawings from the sheet. const allDrawings = sheet.getDrawings();  // Logs the number of drawings present on the sheet. console.log(allDrawings.length);

वापसी का टिकट

Drawing[] — इस शीट पर मौजूद ड्रॉइंग की सूची.

अनुमति देना

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

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

getFilter()

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

// Gets the filter on the active sheet. const ss = SpreadsheetApp.getActiveSheet(); const filter = ss.getFilter();

वापसी का टिकट

Filter — फ़िल्टर.

अनुमति देना

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

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

getFormUrl()

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

const sheet = SpreadsheetApp.getActiveSheet(); const url = sheet.getFormUrl();

वापसी का टिकट

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

अनुमति देना

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

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

getFrozenColumns()

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  Logger.log('Number of frozen columns: %s', sheet.getFrozenColumns());

वापसी का टिकट

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

अनुमति देना

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

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

getFrozenRows()

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  Logger.log('Number of frozen rows: %s', sheet.getFrozenRows());

वापसी का टिकट

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

अनुमति देना

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

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

getImages()

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets spreadsheet, you can use // SpreadsheetApp.getActiveSpreadsheet() instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets the over-the-grid images from Sheet1. // To get the over-the-grid images from the entire spreadsheet, use // ss.getImages() instead. const images = sheet.getImages();  // For each image, logs the anchor cell in A1 notation. for (const image of images) {   console.log(image.getAnchorCell().getA1Notation()); }

वापसी का टिकट

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

अनुमति देना

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

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

getIndex()

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); // Note that the JavaScript index is 0, but this logs 1 const sheet = ss.getSheets()[0]; // ... because spreadsheets are 1-indexed Logger.log(sheet.getIndex());

वापसी का टिकट

Integer — पैरंट स्प्रेडशीट में शीट की पोज़िशन.

अनुमति देना

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

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

getLastColumn()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getLastRow()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getMaxColumns()

यह फ़ंक्शन, शीट में मौजूद कॉलम की मौजूदा संख्या दिखाता है. भले ही, उनमें कोई कॉन्टेंट मौजूद हो या न हो.

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); Logger.log(first.getMaxColumns());

वापसी का टिकट

Integer — शीट की ज़्यादा से ज़्यादा चौड़ाई.

अनुमति देना

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

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

getMaxRows()

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

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); Logger.log(first.getMaxRows());

वापसी का टिकट

Integer — शीट की ज़्यादा से ज़्यादा ऊंचाई.

अनुमति देना

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

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

getName()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getNamedRanges()

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

// The code below logs the name of the first named range. const namedRanges = SpreadsheetApp.getActiveSheet().getNamedRanges(); if (namedRanges.length > 1) {   Logger.log(namedRanges[0].getName()); }

वापसी का टिकट

NamedRange[] — यह शीट में मौजूद सभी नामित श्रेणियों की एक ऐरे होती है.

अनुमति देना

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

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

getParent()

इस शीट को शामिल करने वाला Spreadsheet दिखाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // parent is identical to ss const parent = sheet.getParent();

वापसी का टिकट

Spreadsheet — पैरंट स्प्रेडशीट.

अनुमति देना

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

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

getPivotTables()

इस शीट पर मौजूद सभी पिवट टेबल दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets all the pivot table info for the sheet. const pivotTables = sheet.getPivotTables();  // Logs the pivot tables to the console. for (const pivotTable of pivotTables) {   console.log(pivotTable.getSourceDataRange().getValues()); }

वापसी का टिकट

PivotTable[] — इस शीट में मौजूद पिवट टेबल.

अनुमति देना

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

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

getProtections(type)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getRange(row, column)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Passing only two arguments returns a "range" with a single cell. const range = sheet.getRange(1, 1); const values = range.getValues(); Logger.log(values[0][0]);

पैरामीटर

नामटाइपब्यौरा
rowIntegerउस सेल का लाइन इंडेक्स जिसे दिखाना है. लाइन इंडेक्सिंग की शुरुआत 1 से होती है.
columnIntegerलौटाई जाने वाली सेल का कॉलम इंडेक्स; कॉलम इंडेक्सिंग 1 से शुरू होती है.

वापसी का टिकट

Range — यह सिर्फ़ इस सेल वाली रेंज होती है.

अनुमति देना

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

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

getRange(row, column, numRows)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // When the "numRows" argument is used, only a single column of data is // returned. const range = sheet.getRange(1, 1, 3); const values = range.getValues();  // Prints 3 values from the first column, starting from row 1. for (const row in values) {   for (const col in values[row]) {     Logger.log(values[row][col]);   } }

पैरामीटर

नामटाइपब्यौरा
rowIntegerयह रेंज की शुरुआती लाइन का इंडेक्स होता है. लाइन इंडेक्सिंग की शुरुआत 1 से होती है.
columnIntegerयह रेंज का कॉलम इंडेक्स होता है. कॉलम इंडेक्सिंग की शुरुआत 1 से होती है.
numRowsIntegerलौटाई जाने वाली पंक्तियों की संख्या.

वापसी का टिकट

Range — यह एक ऐसी रेंज होती है जिसमें डेटा का एक कॉलम होता है. इसमें पंक्तियों की संख्या तय की जाती है.

अनुमति देना

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

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

getRange(row, column, numRows, numColumns)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange(1, 1, 3, 3); const values = range.getValues();  // Print values from a 3x3 box. for (const row in values) {   for (const col in values[row]) {     Logger.log(values[row][col]);   } }

पैरामीटर

नामटाइपब्यौरा
rowIntegerयह रेंज की शुरुआती लाइन का इंडेक्स होता है. लाइन इंडेक्सिंग की शुरुआत 1 से होती है.
columnIntegerयह रेंज का शुरुआती कॉलम इंडेक्स होता है. कॉलम इंडेक्सिंग की शुरुआत 1 से होती है.
numRowsIntegerलौटाई जाने वाली पंक्तियों की संख्या.
numColumnsIntegerकितने कॉलम लौटाने हैं, इसे बताने वाली संख्या.

वापसी का टिकट

Range — यह तय किए गए क्षेत्र के हिसाब से रेंज होती है.

अनुमति देना

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

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

getRange(a1Notation)

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

// Get a range A1:D4 on sheet titled "Invoices" const ss = SpreadsheetApp.getActiveSpreadsheet(); const range = ss.getRange('Invoices!A1:D4');  // Get cell A1 on the first sheet const sheet = ss.getSheets()[0]; const cell = sheet.getRange('A1');

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getRangeList(a1Notations)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getRowGroup(rowIndex, groupDepth)

यह फ़ंक्शन, दिए गए इंडेक्स और ग्रुप डेप्थ पर मौजूद पंक्ति ग्रुप दिखाता है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // Returns the group whose control index is at row 2 and has a depth of 1, or // null if the group doesn’t exist. const rowGroup = sheet.getRowGroup(2, 1);

पैरामीटर

नामटाइपब्यौरा
rowIndexIntegerग्रुप कंट्रोल टॉगल का लाइन इंडेक्स या ग्रुप में मौजूद कोई इंडेक्स.
groupDepthIntegerग्रुप की डेप्थ.

वापसी का टिकट

Group — कंट्रोल इंडेक्स और डेप्थ पर मौजूद लाइन ग्रुप या अगर ग्रुप मौजूद नहीं है, तो अपवाद दिखाता है.

अनुमति देना

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

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

getRowGroupControlPosition()

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // GroupControlTogglePosition.AFTER if the row grouping control toggle is shown // after the group. const rowGroupControlPosition = sheet.getRowGroupControlPosition();

वापसी का टिकट

GroupControlTogglePositiontrue अगर इस शीट पर ग्रुप के बाद लाइन ग्रुपिंग कंट्रोल टॉगल दिखाया जाता है और false ऐसा न होने पर.

अनुमति देना

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

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

getRowGroupDepth(rowIndex)

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

ग्रुप डेप्थ से पता चलता है कि कितनी पंक्तियां एक-दूसरे से ओवरलैप हो रही हैं. यह वैल्यू शून्य से आठ के बीच हो सकती है.

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];  // 1 if there is a group over rows 1 through 3 const groupDepth = sheet.getRowGroupDepth(1);

पैरामीटर

नामटाइपब्यौरा
rowIndexIntegerलाइन का इंडेक्स.

वापसी का टिकट

Integer — दिए गए इंडेक्स पर मौजूद लाइन के ग्रुप की डेप्थ.

अनुमति देना

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

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

getRowHeight(rowPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Rows start at 1 Logger.log(sheet.getRowHeight(1));

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getSelection()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getSheetId()

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

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getSheetName()

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

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

वापसी का टिकट

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

अनुमति देना

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

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

getSheetValues(startRow, startColumn, numRows, numColumns)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // The two samples below produce the same output let values = sheet.getSheetValues(1, 1, 3, 3); Logger.log(values);  const range = sheet.getRange(1, 1, 3, 3); values = range.getValues(); Logger.log(values);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getSlicers()

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets all slicers in the spreadsheet. const slicers = sheet.getSlicers();  // Logs the slicer titles to the console. for (const slicer of slicers) {   console.log(slicer.getTitle()); }

वापसी का टिकट

Slicer[] — इस शीट पर मौजूद स्लाइसर की सूची.

अनुमति देना

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

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

getTabColorObject()

यह शीट टैब का रंग दिखाता है. अगर शीट टैब का कोई रंग नहीं है, तो null दिखाता है.

// This example assumes there is a sheet named "Sheet1" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('Sheet1'); const color = first.getTabColorObject();

वापसी का टिकट

Color — यह शीट टैब का रंग होता है. अगर शीट टैब में कोई रंग नहीं है, तो null दिखता है.

अनुमति देना

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

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

getType()

शीट का टाइप दिखाता है.

डिफ़ॉल्ट रूप से, शीट का टाइप SheetType.GRID होता है. जिस शीट में सिर्फ़ एक एम्बेड किया गया ऑब्जेक्ट होता है, जैसे कि EmbeddedChart, उसे SheetType.OBJECT शीट कहते हैं.

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

वापसी का टिकट

SheetType — यह शीट का टाइप है.

अनुमति देना

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

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

hasHiddenGridlines()

अगर शीट की ग्रिडलाइन छिपी हुई हैं, तो true दिखाता है. ऐसा न होने पर, false दिखाता है. ग्रिडलाइन डिफ़ॉल्ट रूप से दिखती हैं.

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Checks if the spreadsheet has hidden gridelines and logs the result to the // console. console.log(sheet.hasHiddenGridlines());

वापसी का टिकट

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

अनुमति देना

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

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

hideColumn(column)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This hides the first column let range = sheet.getRange('A1'); sheet.hideColumn(range);  // This hides the first 3 columns range = sheet.getRange('A:C'); sheet.hideColumn(range);

पैरामीटर

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

अनुमति देना

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

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

hideColumns(columnIndex)

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

इंडेक्स का इस्तेमाल करके एक से ज़्यादा कॉलम छिपाने के लिए, hideColumns(columnIndex, numColumns) का इस्तेमाल करें.

किसी रेंज का इस्तेमाल करके एक से ज़्यादा कॉलम छिपाने के लिए, hideColumn() का इस्तेमाल करें.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first column sheet.hideColumns(1);

पैरामीटर

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

अनुमति देना

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

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

hideColumns(columnIndex, numColumns)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first three columns sheet.hideColumns(1, 3);

पैरामीटर

नामटाइपब्यौरा
columnIndexIntegerउन कॉलम का शुरुआती इंडेक्स जिन्हें छिपाना है.
numColumnsIntegerछिपाए जाने वाले कॉलम की संख्या.

अनुमति देना

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

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

hideRow(row)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This hides the first row const range = sheet.getRange('A1'); sheet.hideRow(range);

पैरामीटर

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

अनुमति देना

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

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

hideRows(rowIndex)

दिए गए इंडेक्स पर मौजूद लाइन को छिपाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first row sheet.hideRows(1);

पैरामीटर

नामटाइपब्यौरा
rowIndexIntegerछिपाने के लिए लाइन का इंडेक्स.

अनुमति देना

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

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

hideRows(rowIndex, numRows)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Hides the first three rows sheet.hideRows(1, 3);

पैरामीटर

नामटाइपब्यौरा
rowIndexIntegerछुपाई जाने वाली लाइनों का शुरुआती इंडेक्स.
numRowsIntegerछिपाने के लिए पंक्तियों की संख्या.

अनुमति देना

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

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

hideSheet()

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

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

वापसी का टिकट

Sheet — मौजूदा शीट.

अनुमति देना

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

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

insertChart(chart)

इस शीट में एक नया चार्ट जोड़ता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This creates a simple bar chart from the first three rows // of the first two columns of the spreadsheet const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(sheet.getRange('A1:B4'))                   .setPosition(5, 5, 0, 0)                   .setOption('title', 'Dynamic Chart')                   .build(); sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
chartEmbeddedChartशामिल किया जाने वाला चार्ट.

अनुमति देना

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

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

insertColumnAfter(afterPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This inserts a column after the first column position sheet.insertColumnAfter(1);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertColumnBefore(beforePosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This inserts a column in the first column position sheet.insertColumnBefore(1);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertColumns(columnIndex)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all columns by one sheet.insertColumns(1);

पैरामीटर

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

अनुमति देना

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

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

insertColumns(columnIndex, numColumns)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all columns by three sheet.insertColumns(1, 3);

पैरामीटर

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

अनुमति देना

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

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

insertColumnsAfter(afterPosition, howMany)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Inserts two columns after the first column on the first sheet of the // spreadsheet. sheet.insertColumnsAfter(1, 2);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertColumnsBefore(beforePosition, howMany)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This inserts five columns before the first column sheet.insertColumnsBefore(1, 5);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertImage(blobSource, column, row)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertImage(url, column, row)

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

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  sheet.insertImage('https://www.google.com/images/srpr/logo3w.png', 1, 1);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

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

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

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  sheet.insertImage(     'https://www.google.com/images/srpr/logo3w.png',     1,     1,     10,     10, );

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRowAfter(afterPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This inserts a row after the first row position sheet.insertRowAfter(1);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRowBefore(beforePosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This inserts a row before the first row position sheet.insertRowBefore(1);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRows(rowIndex)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all rows down by one sheet.insertRows(1);

पैरामीटर

नामटाइपब्यौरा
rowIndexIntegerयह इंडेक्स बताता है कि लाइन कहां जोड़नी है.

अनुमति देना

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

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

insertRows(rowIndex, numRows)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Shifts all rows down by three sheet.insertRows(1, 3);

पैरामीटर

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

अनुमति देना

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

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

insertRowsAfter(afterPosition, howMany)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This inserts five rows after the first row sheet.insertRowsAfter(1, 5);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertRowsBefore(beforePosition, howMany)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This inserts five rows before the first row sheet.insertRowsBefore(1, 5);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertSlicer(range, anchorRowPos, anchorColPos)

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets the range of the sheet. const range = sheet.getRange('A1:D10');  // Inserts the slicer with a random range into the sheet. const insertSlicers = sheet.insertSlicer(range.randomize(), 1, 10);  // Logs the insert slicer result to the console. console.log(insertSlicers);

पैरामीटर

नामटाइपब्यौरा
rangeRangeवह रेंज जिस पर स्लाइसर बनाया गया है.
anchorRowPosIntegerस्लाइसर का ऊपरी हिस्सा इस लाइन में ऐंकर किया गया है.
anchorColPosIntegerस्लाइसर का ऊपरी हिस्सा इस कॉलम में ऐंकर किया गया है.

वापसी का टिकट

Slicer — यह नया स्लाइसर है.

अनुमति देना

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

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

insertSlicer(range, anchorRowPos, anchorColPos, offsetX, offsetY)

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Gets the range. const range = sheet.getRange('A1:D10');  // Inserts a slicer using the random range function. const insertSlicers = sheet.insertSlicer(range.randomize(), 1, 10, 0, 0);  // Logs the insert slicer result to the console. console.log(insertSlicers);

पैरामीटर

नामटाइपब्यौरा
rangeRangeवह रेंज जिस पर स्लाइसर बनाया गया है.
anchorRowPosIntegerस्लाइसर का ऊपरी हिस्सा इस लाइन में ऐंकर किया गया है.
anchorColPosIntegerस्लाइसर का ऊपरी हिस्सा इस कॉलम में ऐंकर किया गया है.
offsetXIntegerसेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट, पिक्सल में.
offsetYIntegerसेल के कोने से वर्टिकल ऑफ़सेट, पिक्सल में.

वापसी का टिकट

Slicer — यह नया स्लाइसर है.

अनुमति देना

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

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

isColumnHiddenByUser(columnPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Columns start at 1 Logger.log(sheet.isColumnHiddenByUser(1));

पैरामीटर

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

वापसी का टिकट

Boolean — अगर कॉलम छिपा हुआ है, तो true. अगर कॉलम छिपा हुआ नहीं है, तो false.

अनुमति देना

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

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

isRightToLeft()

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

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Checks if a spreadsheet is ordered from right to left and logs the result to // the console. console.log(sheet.isRightToLeft());

वापसी का टिकट

Booleantrue अगर दाएं से बाएं की ओर लिखा जाता है; false अन्य मामलों में.

अनुमति देना

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

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

isRowHiddenByFilter(rowPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Rows start at 1 Logger.log(sheet.isRowHiddenByFilter(1));

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

isRowHiddenByUser(rowPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Rows start at 1 Logger.log(sheet.isRowHiddenByUser(1));

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

isSheetHidden()

अगर शीट अभी छिपी हुई है, तो यह फ़ंक्शन true दिखाता है.

const sheet = SpreadsheetApp.getActiveSheet(); if (sheet.isSheetHidden()) {   // do something... }

वापसी का टिकट

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

अनुमति देना

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

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

moveColumns(columnSpec, destinationIndex)

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

// The code below moves rows A-B to destination index 5. // This results in those columns becoming columns C-D. const sheet = SpreadsheetApp.getActiveSheet(); // Selects column A and column B to be moved. const columnSpec = sheet.getRange('A1:B1'); sheet.moveColumns(columnSpec, 5);

पैरामीटर

नामटाइपब्यौरा
columnSpecRangeउन कॉलम की रेंज जिन्हें मूव करना है.
destinationIndexIntegerवह इंडेक्स जहां कॉलम को ले जाना है. ध्यान दें कि यह इंडेक्स, कॉलम को ले जाने से पहले के निर्देशांकों पर आधारित होता है. मौजूदा डेटा को दाईं ओर ले जाया जाता है, ताकि ले जाए गए कॉलम के लिए जगह बन सके. साथ ही, सोर्स कॉलम को ग्रिड से हटा दिया जाता है. इसलिए, हो सकता है कि डेटा उस इंडेक्स पर न दिखे जिस पर उसे दिखना चाहिए.

अनुमति देना

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

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

moveRows(rowSpec, destinationIndex)

इस फ़ंक्शन की मदद से, दी गई रेंज में चुनी गई लाइनों को destinationIndex से दिखाई गई जगह पर ले जाया जाता है. rowSpec को किसी लाइन या लाइनों के ग्रुप को दूसरी जगह ले जाने के लिए, उसे पूरी तरह से चुनने की ज़रूरत नहीं होती. यह उस रेंज में मौजूद सभी लाइनों को चुनता है.

// The code below moves rows 1-2 to destination index 5. // This results in those rows becoming rows 3-4. const sheet = SpreadsheetApp.getActiveSheet(); // Selects row 1 and row 2 to be moved. const rowSpec = sheet.getRange('A1:A2'); sheet.moveRows(rowSpec, 5);

पैरामीटर

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

अनुमति देना

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

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

newChart()

यह फ़ंक्शन, इस शीट के लिए नया चार्ट बनाने के लिए बिल्डर दिखाता है.

इस उदाहरण में, नया चार्ट बनाने का तरीका बताया गया है:

const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('A1:B8'); const chartBuilder = sheet.newChart(); chartBuilder.addRange(range)     .setChartType(Charts.ChartType.LINE)     .setPosition(2, 2, 0, 0)     .setOption('title', 'My Line Chart!'); sheet.insertChart(chartBuilder.build());

वापसी का टिकट

EmbeddedChartBuilder — यह एक बिल्डर है, जिसकी मदद से नया चार्ट बनाया जा सकता है.


protect()

यह एक ऐसा ऑब्जेक्ट बनाता है जो शीट को उन उपयोगकर्ताओं के अलावा किसी और से सुरक्षित रख सकता है जिनके पास अनुमति है. जब तक स्क्रिप्ट, शीट के एडिटर की सूची में बदलाव नहीं करती (Protection.removeEditor(emailAddress), Protection.removeEditor(user), Protection.removeEditors(emailAddresses), Protection.addEditor(emailAddress), Protection.addEditor(user), Protection.addEditors(emailAddresses) को कॉल करके या Protection.setDomainEdit(editable) के लिए नई वैल्यू सेट करके), तब तक अनुमतियां स्प्रेडशीट की अनुमतियों के जैसी ही होती हैं. इसका मतलब है कि शीट सुरक्षित नहीं रहती. अगर शीट पहले से सुरक्षित है, तो यह तरीका सुरक्षा से जुड़ी मौजूदा सेटिंग को दिखाने वाला ऑब्जेक्ट दिखाता है. सुरक्षित की गई किसी शीट में, असुरक्षित किए गए हिस्से शामिल हो सकते हैं.

// Protect the active sheet, then remove all other users from the list of // editors. const sheet = SpreadsheetApp.getActiveSheet(); const protection = sheet.protect().setDescription('Sample protected sheet');  // Ensure the current user is an editor before removing others. Otherwise, if // the user's edit permission comes from a group, the script throws an exception // upon removing the group. const me = Session.getEffectiveUser(); protection.addEditor(me); protection.removeEditors(protection.getEditors()); if (protection.canDomainEdit()) {   protection.setDomainEdit(false); }

वापसी का टिकट

Protection — सुरक्षा सेटिंग दिखाने वाला ऑब्जेक्ट.

अनुमति देना

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

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

removeChart(chart)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This removes all the embedded charts from the spreadsheet const charts = sheet.getCharts(); for (const i in charts) {   sheet.removeChart(charts[i]); }

पैरामीटर

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

अनुमति देना

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

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

setActiveRange(range)

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); const range = sheet.getRange('A1:D4'); sheet.setActiveRange(range);  const selection = sheet.getSelection(); // Current cell: A1 const currentCell = selection.getCurrentCell(); // Active Range: A1:D4 const activeRange = selection.getActiveRange();

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setActiveRangeList(rangeList)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setActiveSelection(range)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:D4'); sheet.setActiveSelection(range);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setActiveSelection(a1Notation)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  sheet.setActiveSelection('A1:D4');

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setColumnGroupControlPosition(position)

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; sheet.setColumnGroupControlPosition(     SpreadsheetApp.GroupControlTogglePosition.AFTER, );

पैरामीटर

नामटाइपब्यौरा
positionGroupControlTogglePositionकॉलम ग्रुप कंट्रोल टॉगल की पोज़िशन.

वापसी का टिकट

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

अनुमति देना

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

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

setColumnWidth(columnPosition, width)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sets the first column to a width of 200 pixels sheet.setColumnWidth(1, 200);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setColumnWidths(startColumn, numColumns, width)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sets the first three columns to a width of 200 pixels sheet.setColumnWidths(1, 3, 200);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setConditionalFormatRules(rules)

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

// Remove one of the existing conditional format rules. const sheet = SpreadsheetApp.getActiveSheet(); const rules = sheet.getConditionalFormatRules(); rules.splice(1, 1);  // Deletes the 2nd format rule. sheet.setConditionalFormatRules(rules);

पैरामीटर

नामटाइपब्यौरा
rulesConditionalFormatRule[]शर्त के साथ फ़ॉर्मैटिंग के नए नियम.

अनुमति देना

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

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

setCurrentCell(cell)

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

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

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

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); const cell = sheet.getRange('B5'); sheet.setCurrentCell(cell);  const selection = sheet.getSelection(); // Current cell: B5 const currentCell = selection.getCurrentCell();

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setFrozenColumns(columns)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Freezes the first column sheet.setFrozenColumns(1);

पैरामीटर

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

अनुमति देना

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

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

setFrozenRows(rows)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Freezes the first row sheet.setFrozenRows(1);

पैरामीटर

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

अनुमति देना

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

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

setHiddenGridlines(hideGridlines)

यह शीट की ग्रिडलाइन को छिपाता या दिखाता है.

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can us eSpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Hides the gridlines in the sheet. sheet.setHiddenGridlines(true);

पैरामीटर

नामटाइपब्यौरा
hideGridlinesBooleanअगर true है, तो इस शीट में ग्रिडलाइन छिपाएं. अगर ऐसा नहीं है, तो ग्रिडलाइन दिखाएं.

वापसी का टिकट

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

अनुमति देना

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

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

setName(name)

यह कुकी, शीट का नाम सेट करती है.

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.setName('not first anymore');

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setRightToLeft(rightToLeft)

इस विकल्प का इस्तेमाल करके, शीट के लेआउट को दाएं से बाएं पर सेट या अनसेट किया जाता है.

// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl(     'https://docs.google.com/spreadsheets/d/abc123456/edit', );  // Gets a sheet by its name. const sheet = ss.getSheetByName('Sheet1');  // Sets the sheet layout, so that the sheet is ordered from right to left. sheet.setRightToLeft(true);

पैरामीटर

नामटाइपब्यौरा
rightToLeftBooleanअगर true है, तो शीट का लेआउट दाईं से बाईं ओर सेट होता है. इसमें सेल A1, सबसे ऊपर दाएं कोने में होता है. अगर false है, तो शीट का लेआउट डिफ़ॉल्ट रूप से बाएं से दाएं पर सेट होता है. इसमें सेल A1 सबसे ऊपर बाईं ओर होता है.

वापसी का टिकट

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

अनुमति देना

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

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

setRowGroupControlPosition(position)

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

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; sheet.setRowGroupControlPosition(     SpreadsheetApp.GroupControlTogglePosition.AFTER, );

पैरामीटर

नामटाइपब्यौरा
positionGroupControlTogglePositionलाइन ग्रुप कंट्रोल टॉगल की जगह.

वापसी का टिकट

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

अनुमति देना

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

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

setRowHeight(rowPosition, height)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sets the first row to a height of 200 pixels sheet.setRowHeight(1, 200);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setRowHeights(startRow, numRows, height)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sets the first three rows to a height of 20 pixels sheet.setRowHeights(1, 3, 20);

पैरामीटर

नामटाइपब्यौरा
startRowIntegerबदलाव करने के लिए, शुरुआती लाइन की जगह.
numRowsIntegerबदली जाने वाली पंक्तियों की संख्या.
heightIntegerइसे सेट करने के लिए पिक्सल में ऊंचाई.

वापसी का टिकट

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

अनुमति देना

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

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

setRowHeightsForced(startRow, numRows, height)

इससे दी गई पंक्तियों की ऊंचाई पिक्सल में सेट की जाती है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियों की ऊंचाई बढ़ जाती है. setRowHeightsForced का इस्तेमाल करने पर, पंक्तियों की ऊंचाई को तय की गई ऊंचाई पर सेट कर दिया जाता है. भले ही, सेल का कॉन्टेंट पंक्ति की ऊंचाई से ज़्यादा हो.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sets the first three rows to a height of 5 pixels. sheet.setRowHeightsForced(1, 3, 5);

पैरामीटर

नामटाइपब्यौरा
startRowIntegerबदलाव करने के लिए, शुरुआती लाइन की जगह.
numRowsIntegerबदली जाने वाली पंक्तियों की संख्या.
heightIntegerइसे सेट करने के लिए पिक्सल में ऊंचाई.

वापसी का टिकट

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

अनुमति देना

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

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

setTabColor(color)

शीट टैब का रंग सेट करता है.

// This example assumes there is a sheet named "first" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('first'); first.setTabColor('ff0000');  // Set the color to red. first.setTabColor(null);      // Unset the color.

पैरामीटर

नामटाइपब्यौरा
colorStringसीएसएस नोटेशन में रंग का कोड (जैसे, '#ffffff' या 'white') या टैब के रंग को रीसेट करने के लिए null.

वापसी का टिकट

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

अनुमति देना

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

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

setTabColorObject(color)

शीट टैब का रंग सेट करता है.

// This example assumes there is a sheet named "Sheet1" const ss = SpreadsheetApp.getActiveSpreadsheet(); const first = ss.getSheetByName('Sheet1'); const color = SpreadsheetApp.newColor()                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1)                   .build(); first.setTabColorObject(color);  // Set the color to theme accent 1. first.setTabColorObject(null);   // Unset the color.

पैरामीटर

नामटाइपब्यौरा
colorColorसेट करने के लिए शीट टैब का रंग.

वापसी का टिकट

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

अनुमति देना

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

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

showColumns(columnIndex)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first column sheet.showColumns(1);

पैरामीटर

नामटाइपब्यौरा
columnIndexIntegerदिखाए जाने वाले कॉलम का इंडेक्स.

अनुमति देना

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

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

showColumns(columnIndex, numColumns)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first three columns sheet.showColumns(1, 3);

पैरामीटर

नामटाइपब्यौरा
columnIndexIntegerउन कॉलम का शुरुआती इंडेक्स जिन्हें दिखाना है.
numColumnsIntegerअनहाइड किए जाने वाले कॉलम की संख्या.

अनुमति देना

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

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

showRows(rowIndex)

इस तरीके का इस्तेमाल करके, दिए गए इंडेक्स पर मौजूद लाइन को वापस दिखाया जा सकता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first row sheet.showRows(1);

पैरामीटर

नामटाइपब्यौरा
rowIndexIntegerवह इंडेक्स जिसे दिखाना है.

अनुमति देना

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

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

showRows(rowIndex, numRows)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // Unhides the first three rows sheet.showRows(1, 3);

पैरामीटर

नामटाइपब्यौरा
rowIndexIntegerअनहाइड की जाने वाली लाइनों का शुरुआती इंडेक्स.
numRowsIntegerछुपाई गई पंक्तियों की संख्या.

अनुमति देना

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

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

showSheet()

इससे शीट दिखने लगती है. अगर शीट पहले से दिख रही है, तो इस विकल्प का कोई असर नहीं होता.

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

वापसी का टिकट

Sheet — मौजूदा शीट.

अनुमति देना

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

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

sort(columnPosition)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sorts the sheet by the first column, ascending sheet.sort(1);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

sort(columnPosition, ascending)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // Sorts the sheet by the first column, descending sheet.sort(1, false);

पैरामीटर

नामटाइपब्यौरा
columnPositionIntegerजिस कॉलम के हिसाब से क्रम से लगाना है.
ascendingBooleanबढ़ते क्रम के लिए true और घटते क्रम के लिए false.

वापसी का टिकट

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

अनुमति देना

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

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

unhideColumn(column)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This unhides the first column if it was previously hidden const range = sheet.getRange('A1'); sheet.unhideColumn(range);

पैरामीटर

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

अनुमति देना

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

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

unhideRow(row)

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

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This unhides the first row if it was previously hidden const range = sheet.getRange('A1'); sheet.unhideRow(range);

पैरामीटर

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

अनुमति देना

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

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

updateChart(chart)

इस शीट पर मौजूद चार्ट को अपडेट करता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This code is going to loop through all the charts and change them to // column charts const charts = sheet.getCharts(); for (const i in charts) {   const chart = charts[i];   const newChart = chart.modify().setChartType(Charts.ChartType.COLUMN).build();   sheet.updateChart(newChart); }

पैरामीटर

नामटाइपब्यौरा
chartEmbeddedChartअपडेट किया जाने वाला चार्ट.

अनुमति देना

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

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

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