स्प्रेडशीट शीट ऐक्सेस करना और उनमें बदलाव करना. सामान्य ऑपरेशन के तहत शीट का नाम बदला जाता है और शीट से रेंज ऑब्जेक्ट को ऐक्सेस किया जाता है.
तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
---|---|---|
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 के तौर पर दिखाता है. अगर ऐसा नहीं है, तो शीट को 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 दिखाता है. |
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 | A1 संकेतन या R1C1 संकेतनों की गैर-खाली सूची से तय की गई समान शीट में मौजूद रेंज को दिखाने वाला RangeList संग्रह देता है. |
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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var 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());
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
रिटर्न
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());
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
visibility | DeveloperMetadataVisibility | नए डेवलपर मेटाडेटा का 'किसको दिखे' सेटिंग. |
रिटर्न
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());
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
रिटर्न
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());
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
visibility | DeveloperMetadataVisibility | नए डेवलपर मेटाडेटा का 'किसको दिखे' सेटिंग. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
appendRow(rowContents)
शीट में मौजूदा डेटा क्षेत्र में सबसे नीचे एक लाइन जोड़ता है. अगर किसी सेल का कॉन्टेंट =
से शुरू होता है, तो उसे एक फ़ॉर्मूला माना जाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Appends a new row with 3 columns to the bottom of the current // data region in the sheet containing the values in the array. sheet.appendRow(["a man", "a plan", "panama"]);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowContents | Object[] | शीट में आखिरी लाइन के बाद शामिल की जाने वाली वैल्यू का कलेक्शन. |
रिटर्न
Sheet
— यह शीट, मेथड चेन में काम की है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
asDataSourceSheet()
अगर शीट SheetType.DATASOURCE
टाइप की है, तो शीट को DataSourceSheet
के तौर पर दिखाता है. अगर ऐसा नहीं है, तो शीट को 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)
दिए गए कॉलम की चौड़ाई को इसकी सामग्री के हिसाब से सेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; sheet.getRange('a1').setValue('Whenever it is a damp, drizzly November in my soul...'); // Sets the first column to a width which fits the text sheet.autoResizeColumn(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | आकार बदलने के लिए दिए गए कॉलम की स्थिति. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
autoResizeColumns(startColumn, numColumns)
किसी कॉलम की जगह से शुरू होने वाले सभी कॉलम की चौड़ाई को उनकी सामग्री के मुताबिक सेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sets the first 15 columns to a width that fits their text. sheet.autoResizeColumns(1, 15);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
startColumn | Integer | अपने-आप साइज़ बदलने के लिए शुरुआती कॉलम. |
numColumns | Integer | उन कॉलम की संख्या जिनका साइज़ अपने-आप बदलना है. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
autoResizeRows(startRow, numRows)
दी गई पंक्ति की जगह से शुरू होने वाली सभी पंक्तियों की सामग्री के मुताबिक ऊंचाई सेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sets the first 15 rows to a height that fits their text. sheet.autoResizeRows(1, 15);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
startRow | Integer | अपने-आप साइज़ बदलने के लिए शुरुआती पंक्ति. |
numRows | Integer | अपने-आप साइज़ बदलने वाली पंक्तियों की संख्या. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
clear()
कॉन्टेंट की शीट और फ़ॉर्मैटिंग की जानकारी को मिटा देता है.
// This example assumes there is a sheet named "first" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("first"); first.clear();
रिटर्न
Sheet
— मिटाई गई शीट.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
clear(options)
दिए गए बेहतर विकल्पों में बताए गए तरीके के हिसाब से, कॉन्टेंट और/या फ़ॉर्मैट की शीट को साफ़ करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; sheet.clear({ formatOnly: true, contentsOnly: true });
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
options | Object | बेहतर विकल्पों वाला JavaScript मैप, जिनकी सूची नीचे दी गई है. |
उन्नत पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
contentsOnly | Boolean | कॉन्टेंट हटाना है या नहीं. |
formatOnly | Boolean | फ़ॉर्मैट मिटाना है या नहीं. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
clearConditionalFormatRules()
शीट से कंडिशनल फ़ॉर्मैट के सभी नियम हटा दिए जाते हैं. इनपुट के तौर पर, खाली कलेक्शन वाले setConditionalFormatRules(rules)
को कॉल करने के बराबर.
var 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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var 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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var 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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("first"); first.clearNotes();
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
collapseAllColumnGroups()
शीट पर मौजूद सभी कॉलम ग्रुप को छोटा करता है.
var 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()
शीट पर मौजूद सभी पंक्ति ग्रुप को छोटा करता है.
var 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] की कॉपी" होता है.
var source = SpreadsheetApp.getActiveSpreadsheet(); var sheet = source.getSheets()[0]; var destination = SpreadsheetApp.openById('ID_GOES HERE'); sheet.copyTo(destination);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
spreadsheet | Spreadsheet | वह स्प्रेडशीट जिसमें इस शीट को कॉपी करना है. यह सोर्स वाली स्प्रेडशीट हो सकती है. |
रिटर्न
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)
शीट के लिए टेक्स्ट फ़ाइंडर बनाता है, जो शीट में टेक्स्ट ढूंढ सकता है और उसे बदल सकता है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // Creates a text finder. var textFinder = sheet.createTextFinder('dog'); // Returns the first occurrence of 'dog' in the sheet. var firstOccurrence = textFinder.findNext(); // Replaces the last found occurrence of 'dog' with 'cat' and returns the number // of occurrences replaced. var numOccurrencesReplaced = findOccurrence.replaceWith('cat');
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
findText | String | खोजा जाने वाला टेक्स्ट. |
रिटर्न
TextFinder
— शीट के लिए TextFinder
.
deleteColumn(columnPosition)
दिए गए कॉलम की जगह से कॉलम मिटाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Columns start at "1" - this deletes the first column sheet.deleteColumn(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | कॉलम की जगह, पहले कॉलम के लिए 1 से शुरू. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
deleteColumns(columnPosition, howMany)
दिए गए कॉलम की जगह से शुरू होने वाले कई कॉलम मिटाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Columns start at "1" - this deletes the first two columns sheet.deleteColumns(1, 2);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | मिटाए जाने वाले पहले कॉलम की जगह. |
howMany | Integer | मिटाए जाने वाले कॉलम की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
deleteRow(rowPosition)
दी गई पंक्ति की जगह से पंक्ति मिटाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Rows start at "1" - this deletes the first row sheet.deleteRow(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowPosition | Integer | पहली पंक्ति के लिए 1 से शुरू करते हुए पंक्ति की स्थिति. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
deleteRows(rowPosition, howMany)
दी गई पंक्ति की जगह से शुरू होने वाली कई पंक्तियां मिटाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Rows start at "1" - this deletes the first two rows sheet.deleteRows(1, 2);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowPosition | Integer | मिटाई जाने वाली पहली पंक्ति की जगह. |
howMany | Integer | मिटाई जाने वाली पंक्तियों की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
expandAllColumnGroups()
शीट में मौजूद सभी कॉलम ग्रुप को बड़ा करता है. इस तरीके के लिए कम से कम एक कॉलम ग्रुप होना ज़रूरी है.
var 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()
शीट में मौजूद सभी पंक्ति ग्रुप को बड़ा करता है. इस तरीके के लिए कम से कम एक पंक्ति समूह होना ज़रूरी है.
var 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)
यह फ़ंक्शन दिए गए डेटा की गहराई तक सभी कॉलम ग्रुप को बड़ा करता है और बाकी सभी को छोटा करता है.
var 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);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
groupDepth | Integer | ग्रुप की गहराई जहां तक कॉलम ग्रुप को बड़ा करना है. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
expandRowGroupsUpToDepth(groupDepth)
यह पंक्ति के सभी ग्रुप को तय की गई गहराई तक बड़ा करता है और बाकी सभी को छोटा करता है.
var 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);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
groupDepth | Integer | वह ग्रुप जिस तक लाइन के ग्रुप को बड़ा करना है. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getActiveCell()
इस शीट में ऐक्टिव सेल की जानकारी देता है.
ध्यान दें: getCurrentCell()
का इस्तेमाल करना बेहतर होता है, जो हाइलाइट किया गया मौजूदा सेल दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Returns the active cell var cell = sheet.getActiveCell();
रिटर्न
Range
— मौजूदा सक्रिय सेल
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getActiveRange()
चालू शीट में चुनी गई रेंज दिखाता है. अगर कोई चालू रेंज नहीं है, तो null
दिखाता है. अगर
एक से ज़्यादा रेंज चुनी जाती हैं, तो यह तरीका सिर्फ़ चुनी गई पिछली रेंज दिखाता है.
"सक्रिय रेंज" शब्द का मतलब उस रेंज से है जिसे उपयोगकर्ता ने सक्रिय शीट में चुना है. लेकिन कस्टम फ़ंक्शन में यह उस सेल को दिखाता है जिसका सक्रिय तौर पर फिर से हिसाब लगाया जा रहा है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var activeRange = sheet.getActiveRange();
रिटर्न
Range
— सक्रिय रेंज
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
getActiveRangeList()
कोई सक्रिय रेंज नहीं होने पर, सक्रिय शीट में सक्रिय रेंज की
सूची दिखाता है या null
.
अगर सिर्फ़ एक रेंज चुनी जाती है, तो यह getActiveRange()
कॉल की तरह काम करता है.
var sheet = SpreadsheetApp.getActiveSheet(); // Returns the list of active ranges. var activeRangeList = sheet.getActiveRangeList();
रिटर्न
RangeList
— चालू रेंज की सूची
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
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()
इस शीट पर चार्ट का कलेक्शन दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var charts = sheet.getCharts(); for (var i in charts) { var 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)
दिए गए इंडेक्स और ग्रुप की गहराई के हिसाब से कॉलम ग्रुप दिखाता है.
var 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. var columnGroup = sheet.getColumnGroup(2, 1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | ग्रुप कंट्रोल के कॉलम इंडेक्स को टॉगल या ग्रुप का इंडेक्स. |
groupDepth | Integer | ग्रुप की गहराई. |
रिटर्न
Group
— कंट्रोल इंडेक्स और डेप्थ पर कॉलम ग्रुप. अगर ग्रुप मौजूद नहीं है, तो यह एक अपवाद दिखाता है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getColumnGroupControlPosition()
शीट में मौजूद सभी कॉलम ग्रुप के लिए GroupControlTogglePosition
दिखाता है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // GroupControlTogglePosition.AFTER if the column grouping control toggle is shown after the // group. var columnGroupControlPosition = sheet.getColumnGroupControlPosition();
रिटर्न
GroupControlTogglePosition
— अगर इस शीट पर मौजूद ग्रुप के बाद, कॉलम ग्रुपिंग का कंट्रोल टॉगल दिखता है, तो
true
. अगर ऐसा नहीं है, तो false
.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getColumnGroupDepth(columnIndex)
दिए गए इंडेक्स में, कॉलम के ग्रुप की गहराई की जानकारी देता है.
ग्रुप डेप्थ से पता चलता है कि कितने ग्रुप, कॉलम के साथ ओवरलैप कर रहे हैं. यह संख्या शून्य से आठ के बीच हो सकती है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // 1 if there is a group over columns 1 through 3 var groupDepth = sheet.getColumnGroupDepth(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | कॉलम का इंडेक्स. |
रिटर्न
Integer
— दिए गए इंडेक्स में, कॉलम के ग्रुप की गहराई.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getColumnWidth(columnPosition)
दिए गए कॉलम की चौड़ाई को पिक्सल में दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Columns start at 1 Logger.log(sheet.getColumnWidth(1));
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | जांच किए जाने वाले कॉलम की जगह. |
रिटर्न
Integer
— कॉलम की चौड़ाई पिक्सल में
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getConditionalFormatRules()
कंडिशनल फ़ॉर्मैट के सभी नियम इस शीट में देखें.
// Logs the conditional format rules in a sheet. var rules = SpreadsheetApp.getActiveSheet().getConditionalFormatRules(); for (var i = 0; i < rules.length; i++) { var rule = rules[i]; Logger.log(rule); }
रिटर्न
ConditionalFormatRule[]
— शीट में मौजूद सभी नियमों का कलेक्शन.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getCurrentCell()
चालू शीट में मौजूदा सेल लौटाता है या अगर कोई मौजूदा सेल नहीं है, तो null
दिखाता है. मौजूदा सेल वह सेल है जिसका फ़ोकस Google Sheets के यूज़र इंटरफ़ेस (यूआई) में है और उसे गहरे रंग के बॉर्डर से हाइलाइट किया जाता है. इसमें कभी भी एक से ज़्यादा सेल नहीं होती हैं. जब कोई उपयोगकर्ता एक या ज़्यादा सेल रेंज चुनता है,
तो चुने गए सेल में से एक सेल मौजूदा सेल होती है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); // Returns the current highlighted cell in the one of the active ranges. var currentCell = sheet.getCurrentCell();
रिटर्न
Range
— मौजूदा सेल
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDataRange()
उस डाइमेंशन के हिसाब से Range
दिखाता है जिसमें डेटा मौजूद होता है.
यह फ़ंक्शनल तौर पर, A1 और (Sheet.getLastColumn(), Sheets.getLastRow()) से बंधी हुई रेंज बनाने के बराबर है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This represents ALL the data var range = sheet.getDataRange(); var values = range.getValues(); // This logs the spreadsheet in CSV format with a trailing comma for (var i = 0; i < values.length; i++) { var row = ""; for (var j = 0; j < values[i].length; j++) { if (values[i][j]) { row = row + values[i][j]; } row = row + ","; } Logger.log(row); }
रिटर्न
Range
— स्प्रेडशीट में मौजूद सभी डेटा की रेंज
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDataSourceFormulas()
डेटा सोर्स के सभी फ़ॉर्मूला की जानकारी मिलती है.
// Opens the spreadsheet by its ID. If you created your script from within a Google Sheets // file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets an array of the data source formulas on Sheet1. // To get an array of data source formulas for the entire spreadsheet, // replace 'sheet' with 'ss'. const dataSourceFormulas = sheet.getDataSourceFormulas(); // Logs the first data source formula in the array. console.log(dataSourceFormulas[0].getFormula());
रिटर्न
DataSourceFormula[]
— डेटा सोर्स के फ़ॉर्मूले की सूची.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDataSourcePivotTables()
सभी डेटा सोर्स की पिवट टेबल लेता है.
// Opens the spreadsheet file by its ID. If you created your script from a Google Sheets file, // use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets an array of the data source pivot tables on Sheet1. // To get an array of data source pivot tables for the entire // spreadsheet, replace 'sheet' with 'ss'. const dataSourcePivotTables = sheet.getDataSourcePivotTables(); // Logs the last time that the first pivot table in the array was refreshed. console.log(dataSourcePivotTables[0].getStatus().getLastRefreshedTime());
रिटर्न
DataSourcePivotTable[]
— डेटा सोर्स में मौजूद पिवट टेबल की सूची.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
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. let ss = SpreadsheetApp.getActiveSheet(); let filter = ss.getFilter();
रिटर्न
Filter
— फ़िल्टर.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFormUrl()
यह फ़ंक्शन उस फ़ॉर्म का यूआरएल दिखाता है जो इस शीट पर अपने जवाब भेजता है. इसके अलावा, अगर इस शीट में कोई फ़ॉर्म जुड़ा हुआ नहीं है, तो null
दिखाता है.
var sheet = SpreadsheetApp.getActiveSheet(); var url = sheet.getFormUrl();
रिटर्न
String
— वह यूआरएल जिस पर फ़ॉर्म के जवाब इस शीट में दिए गए हैं. इसके अलावा, अगर इस शीट में कोई फ़ॉर्म नहीं है, तो null
.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFrozenColumns()
फ़्रीज़ किए गए कॉलम की संख्या दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; Logger.log("Number of frozen columns: %s", sheet.getFrozenColumns());
रिटर्न
Integer
— फ़्रीज़ किए गए कॉलम की संख्या
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFrozenRows()
फ़्रीज़ की गई पंक्तियों की संख्या दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; Logger.log("Number of frozen rows: %s", sheet.getFrozenRows());
रिटर्न
Integer
— फ़्रीज़ की गई पंक्तियों की संख्या
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
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 से शुरू.
var ss = SpreadsheetApp.getActiveSpreadsheet(); // Note that the JavaScript index is 0, but this logs 1 var 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()
कॉन्टेंट वाले आखिरी कॉलम की जगह दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This logs the value in the very last cell of this sheet var lastRow = sheet.getLastRow(); var lastColumn = sheet.getLastColumn(); var lastCell = sheet.getRange(lastRow, lastColumn); Logger.log(lastCell.getValue());
रिटर्न
Integer
— कॉन्टेंट वाली शीट का आखिरी कॉलम
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getLastRow()
कॉन्टेंट वाली आखिरी पंक्ति की जगह दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This logs the value in the very last cell of this sheet var lastRow = sheet.getLastRow(); var lastColumn = sheet.getLastColumn(); var lastCell = sheet.getRange(lastRow, lastColumn); Logger.log(lastCell.getValue());
रिटर्न
Integer
— कॉन्टेंट वाली शीट की आखिरी लाइन
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getMaxColumns()
कॉन्टेंट पर ध्यान दिए बिना, शीट में कॉलम की मौजूदा संख्या दिखाता है.
// This example assumes there is a sheet named "first" var ss = SpreadsheetApp.getActiveSpreadsheet(); var 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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("first"); Logger.log(first.getMaxRows());
रिटर्न
Integer
— शीट की ज़्यादा से ज़्यादा ऊंचाई.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getName()
शीट का नाम दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var 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. var 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
दिखाता है जिसमें यह शीट होती है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // parent is identical to ss var 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. var sheet = SpreadsheetApp.getActiveSheet(); var protections = sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE); for (var i = 0; i < protections.length; i++) { var protection = protections[i]; if (protection.canEdit()) { protection.remove(); } }
// Remove sheet protection from the active sheet, if the user has permission to edit it. var sheet = SpreadsheetApp.getActiveSheet(); var protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0]; if (protection && protection.canEdit()) { protection.remove(); }
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
type | ProtectionType | संरक्षित क्षेत्र का टाइप, SpreadsheetApp.ProtectionType.RANGE या
SpreadsheetApp.ProtectionType.SHEET . |
रिटर्न
Protection[]
— ऑब्जेक्ट का कलेक्शन, जो शीट में सुरक्षित की गई सभी रेंज को दिखाता है. इसके अलावा, कोई एक एलिमेंट वाला कलेक्शन, जो शीट में ही सुरक्षा को दिखाता है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRange(row, column)
दिए गए निर्देशांकों पर, सबसे ऊपर बाएं सेल वाली रेंज लौटाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Passing only two arguments returns a "range" with a single cell. var range = sheet.getRange(1, 1); var values = range.getValues(); Logger.log(values[0][0]);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
row | Integer | दिखाई जाने वाली सेल का पंक्ति इंडेक्स; पंक्ति को इंडेक्स करने की शुरुआत 1 से होती है. |
column | Integer | दिखाए जाने वाले सेल का कॉलम इंडेक्स; कॉलम को इंडेक्स करने की शुरुआत 1 से होती है. |
रिटर्न
Range
— सिर्फ़ इस सेल की रेंज.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRange(row, column, numRows)
दिए गए निर्देशांकों पर सबसे ऊपर बाएं सेल और दी गई पंक्तियों की संख्या के साथ रेंज लौटाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // When the "numRows" argument is used, only a single column of data is returned. var range = sheet.getRange(1, 1, 3); var values = range.getValues(); // Prints 3 values from the first column, starting from row 1. for (var row in values) { for (var col in values[row]) { Logger.log(values[row][col]); } }
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
row | Integer | रेंज की शुरुआती पंक्ति का इंडेक्स; पंक्ति को इंडेक्स करने की शुरुआत 1 से होती है. |
column | Integer | रेंज का कॉलम इंडेक्स; कॉलम को इंडेक्स करने की शुरुआत 1 से होती है. |
numRows | Integer | कितनी पंक्तियां लौटानी हैं. |
रिटर्न
Range
— ऐसी रेंज जिसमें डेटा का एक कॉलम होता है. साथ ही, पंक्तियों की संख्या दी जाती है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRange(row, column, numRows, numColumns)
पंक्तियों और कॉलम की दी गई संख्या के साथ दिए गए निर्देशांक पर, सबसे ऊपर बाएं सेल की रेंज दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var range = sheet.getRange(1, 1, 3, 3); var values = range.getValues(); // Print values from a 3x3 box. for (var row in values) { for (var col in values[row]) { Logger.log(values[row][col]); } }
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
row | Integer | रेंज की शुरुआती पंक्ति का इंडेक्स; पंक्ति को इंडेक्स करने की शुरुआत 1 से होती है. |
column | Integer | रेंज का शुरुआती कॉलम इंडेक्स; कॉलम को इंडेक्स करने की शुरुआत 1 से होती है. |
numRows | Integer | कितनी पंक्तियां लौटानी हैं. |
numColumns | Integer | दिखाए जाने वाले कॉलम की संख्या. |
रिटर्न
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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = ss.getRange("Invoices!A1:D4"); // Get cell A1 on the first sheet var sheet = ss.getSheets()[0]; var cell = sheet.getRange("A1");
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
a1Notation | String | दी जाने वाली श्रेणी, जैसा कि A1 संकेतन या R1C1 संकेतन में बताया गया है. |
रिटर्न
Range
— तय की गई जगह के लिए रेंज
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRangeList(a1Notations)
A1 संकेतन या R1C1 संकेतनों की गैर-खाली सूची से तय की गई समान शीट में मौजूद रेंज को दिखाने वाला RangeList
संग्रह देता है.
// Get a list of ranges A1:D4, F1:H4. var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var rangeList = sheet.getRangeList(['A1:D4', 'F1:H4']);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
a1Notations | String[] | A1 संकेतन या R1C1 संकेतन के मुताबिक दिखाई जाने वाली रेंज की सूची. |
रिटर्न
RangeList
— तय की गई जगह के लिए रेंज की सूची
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRowGroup(rowIndex, groupDepth)
दिए गए इंडेक्स और ग्रुप की गहराई पर पंक्ति ग्रुप दिखाता है.
var 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. var rowGroup = sheet.getRowGroup(2, 1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | ग्रुप कंट्रोल का लाइन इंडेक्स या ग्रुप का कोई इंडेक्स. |
groupDepth | Integer | ग्रुप की गहराई. |
रिटर्न
Group
— कंट्रोल इंडेक्स और डेप्थ पर मौजूद लाइन ग्रुप. इसके अलावा, ग्रुप मौजूद न होने पर,
यह अपवाद दिखाता है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRowGroupControlPosition()
शीट में मौजूद सभी पंक्ति ग्रुप के लिए GroupControlTogglePosition
दिखाता है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // GroupControlTogglePosition.AFTER if the row grouping control toggle is shown after the // group. var rowGroupControlPosition = sheet.getRowGroupControlPosition();
रिटर्न
GroupControlTogglePosition
— true
, अगर इस शीट पर मौजूद ग्रुप के बाद, लाइन को ग्रुप करने का कंट्रोल टॉगल दिखता है,
तो false
.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRowGroupDepth(rowIndex)
दिए गए इंडेक्स में, पंक्ति के ग्रुप की गहराई दिखाता है.
ग्रुप डेप्थ से पता चलता है कि कितने ग्रुप, लाइन को ओवरलैप कर रहे हैं. यह संख्या शून्य से आठ के बीच हो सकती है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // 1 if there is a group over rows 1 through 3 var groupDepth = sheet.getRowGroupDepth(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | पंक्ति का इंडेक्स. |
रिटर्न
Integer
— दिए गए इंडेक्स में मौजूद लाइन के ग्रुप की गहराई.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRowHeight(rowPosition)
दी गई पंक्ति की पिक्सल में ऊंचाई दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Rows start at 1 Logger.log(sheet.getRowHeight(1));
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowPosition | Integer | जांच करने के लिए पंक्ति की जगह. |
रिटर्न
Integer
— पंक्ति की ऊंचाई पिक्सल में
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSelection()
स्प्रेडशीट में मौजूदा Selection
दिखाता है.
var selection = SpreadsheetApp.getActiveSpreadsheet().getSelection(); var currentCell = selection.getCurrentCell();
रिटर्न
Selection
— चुनी गई मौजूदा तारीख
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSheetId()
इस ऑब्जेक्ट से दिखाई गई शीट का आईडी दिखाता है.
यह उस शीट का आईडी है जो स्प्रेडशीट के लिए यूनीक है. यह आईडी, शीट बनाने के समय असाइन किया गया एक ऐसा पूर्णांक होता है जो एक साथ बढ़ते हुए क्रम में होता है. यह शीट की जगह पर निर्भर नहीं करता. यह
Range.copyFormatToRange(gridId, column, columnEnd, row, rowEnd)
जैसे तरीकों के साथ काम का है, जो Sheet
इंस्टेंस के बजाय gridId
पैरामीटर लेता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; Logger.log(sheet.getSheetId());
रिटर्न
Integer
— स्प्रेडशीट के लिए खास शीट का आईडी
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSheetName()
शीट का नाम दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; Logger.log(sheet.getSheetName());
रिटर्न
String
— शीट का नाम
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSheetValues(startRow, startColumn, numRows, numColumns)
दिए गए निर्देशांकों से शुरू करके, इस रेंज के लिए वैल्यू की आयताकार ग्रिड देता है. पंक्ति या कॉलम की जगह के रूप में दी गई -1 वैल्यू, शीट में डेटा वाली आखिरी पंक्ति या कॉलम के नतीजे के बराबर होती है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // The two samples below produce the same output var values = sheet.getSheetValues(1, 1, 3, 3); Logger.log(values); var range = sheet.getRange(1, 1, 3, 3); values = range.getValues(); Logger.log(values);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
startRow | Integer | शुरुआती पंक्ति की जगह. |
startColumn | Integer | शुरुआती कॉलम की जगह. |
numRows | Integer | पंक्तियों की वह संख्या जिनके लिए वैल्यू दी जानी है. |
numColumns | Integer | कॉलम की संख्या जिनके लिए मान देना है. |
रिटर्न
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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("Sheet1"); var color = first.getTabColorObject();
रिटर्न
Color
— शीट टैब का रंग या अगर शीट टैब में कोई रंग नहीं है, तो null
.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getType()
शीट का टाइप दिखाता है.
शीट का डिफ़ॉल्ट टाइप SheetType.GRID
है. जिस शीट में एम्बेड किया गया एक ऑब्जेक्ट होता है,
जैसे कि EmbeddedChart
, उसे SheetType.OBJECT
शीट होती है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var 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)
दी गई रेंज में कॉलम या कॉलम छिपा देता है.
let ss = SpreadsheetApp.getActiveSpreadsheet(); let sheet = ss.getSheets()[0]; // This hides the first column let range = sheet.getRange("A1"); sheet.hideColumn(range); // This hides the first 3 columns let range = sheet.getRange("A:C"); sheet.hideColumn(range);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
column | Range | वह कॉलम रेंज जिसे छिपाना है. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
hideColumns(columnIndex)
दिए गए इंडेक्स में एक कॉलम छिपाता है. इस तरीके के लिए 1-इंडेक्स का इस्तेमाल करें.
इंडेक्स का इस्तेमाल करके एक से ज़्यादा कॉलम छिपाने के लिए, hideColumns(columnIndex, numColumns)
का इस्तेमाल करें.
किसी रेंज का इस्तेमाल करके एक से ज़्यादा कॉलम छिपाने के लिए, hideColumn()
का इस्तेमाल करें.
let ss = SpreadsheetApp.getActiveSpreadsheet(); let sheet = ss.getSheets()[0]; // Hides the first column sheet.hideColumns(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | छिपाने के लिए कॉलम का इंडेक्स. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
hideColumns(columnIndex, numColumns)
दिए गए इंडेक्स से शुरू होने वाले, एक या एक से ज़्यादा लगातार कॉलम को छिपाता है. इस तरीके के लिए 1-इंडेक्स का इस्तेमाल करें.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Hides the first three columns sheet.hideColumns(1, 3);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | छिपाए जाने वाले कॉलम का शुरुआती इंडेक्स. |
numColumns | Integer | छिपाए जाने वाले कॉलम की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
hideRow(row)
दी गई रेंज में पंक्तियां छिपा देता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This hides the first row var range = sheet.getRange("A1"); sheet.hideRow(range);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
row | Range | पंक्ति की वह रेंज जिसे छिपाना है. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
hideRows(rowIndex)
दिए गए इंडेक्स में पंक्ति छिपा देता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Hides the first row sheet.hideRows(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | छिपाने के लिए पंक्ति का इंडेक्स. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
hideRows(rowIndex, numRows)
दिए गए इंडेक्स से शुरू होने वाली, एक या उससे ज़्यादा पंक्तियों को छिपाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Hides the first three rows sheet.hideRows(1, 3);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | छिपाने के लिए पंक्तियों का शुरुआती इंडेक्स. |
numRows | Integer | छिपाई जाने वाली पंक्तियों की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
hideSheet()
इस शीट को छिपा देता है. अगर शीट पहले से ही छिपी हुई है, तो इसका कोई असर नहीं होगा. अगर यह तरीका सिर्फ़ दिखने वाली शीट पर कॉल किया जाता है, तो एक अपवाद दिखता है.
var sheet = SpreadsheetApp.getActiveSheet(); sheet.hideSheet();
रिटर्न
Sheet
— मौजूदा शीट.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertChart(chart)
इस शीट में नया चार्ट जोड़ता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This creates a simple bar chart from the first three rows // of the first two columns of the spreadsheet var 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);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
chart | EmbeddedChart | शामिल किया जाने वाला चार्ट. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertColumnAfter(afterPosition)
दी गई कॉलम की स्थिति के बाद एक कॉलम डालता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This inserts a column after the first column position sheet.insertColumnAfter(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
afterPosition | Integer | वह कॉलम जिसके बाद नया कॉलम जोड़ना है. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertColumnBefore(beforePosition)
दी गई कॉलम की स्थिति से पहले कॉलम डालता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This inserts a column in the first column position sheet.insertColumnBefore(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
beforePosition | Integer | वह कॉलम जिससे पहले नया कॉलम जोड़ना है. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertColumns(columnIndex)
किसी शीट में तय जगह पर खाली कॉलम डालता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Shifts all columns by one sheet.insertColumns(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | वह इंडेक्स जिससे पता चलता है कि कॉलम को कहां शामिल करना है. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertColumns(columnIndex, numColumns)
तय की गई जगह से शुरू होने वाली शीट में, एक या उससे ज़्यादा खाली कॉलम शामिल करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Shifts all columns by three sheet.insertColumns(1, 3);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | वह इंडेक्स जिससे पता चलता है कि कॉलम को कहां शामिल करना है. |
numColumns | Integer | शामिल किए जाने वाले कॉलम की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertColumnsAfter(afterPosition, howMany)
दिए गए कॉलम की स्थिति के बाद, कॉलम की दी गई संख्या को शामिल करता है.
let ss = SpreadsheetApp.getActiveSpreadsheet(); let sheet = ss.getSheets()[0]; // Inserts two columns after the first column on the first sheet of the spreadsheet. sheet.insertColumnsAfter(1,2);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
afterPosition | Integer | वह कॉलम जिसके बाद नया कॉलम जोड़ना है. |
howMany | Integer | शामिल किए जाने वाले कॉलम की संख्या. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertColumnsBefore(beforePosition, howMany)
दिए गए कॉलम की स्थिति से पहले कई कॉलम डालता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This inserts five columns before the first column sheet.insertColumnsBefore(1, 5);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
beforePosition | Integer | वह कॉलम जिससे पहले नया कॉलम जोड़ना है. |
howMany | Integer | शामिल किए जाने वाले कॉलम की संख्या. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertImage(blobSource, column, row)
किसी पंक्ति और कॉलम में, दस्तावेज़ में BlobSource
को इमेज के तौर पर डालता है. इमेज का साइज़, ब्लॉब कॉन्टेंट से लिया जाता है. ब्लॉब का साइज़ ज़्यादा से ज़्यादा 2 एमबी हो सकता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName'); sheet.insertImage(blob, 1, 1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
blobSource | BlobSource | वह ब्लॉब जिसमें इमेज का कॉन्टेंट, MIME टाइप, और (वैकल्पिक तौर पर) नाम होता है. |
column | Integer | कॉलम की स्थिति. |
row | Integer | पंक्ति की जगह. |
रिटर्न
OverGridImage
— शामिल की गई इमेज.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertImage(blobSource, column, row, offsetX, offsetY)
पिक्सल ऑफ़सेट के साथ किसी दी गई पंक्ति और कॉलम में, दस्तावेज़ में BlobSource
को इमेज के तौर पर डालता है. इमेज का साइज़ ब्लॉब कॉन्टेंट से लिया जाता है. ब्लॉब का साइज़ ज़्यादा से ज़्यादा
2 एमबी हो सकता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var blob = Utilities.newBlob(binaryData, 'image/png', 'MyImageName'); sheet.insertImage(blob, 1, 1, 10, 10);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
blobSource | BlobSource | वह ब्लॉब जिसमें इमेज का कॉन्टेंट, MIME टाइप, और (वैकल्पिक तौर पर) नाम होता है. |
column | Integer | कॉलम की स्थिति. |
row | Integer | पंक्ति की जगह. |
offsetX | Integer | पिक्सल में सेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट. |
offsetY | Integer | पिक्सल में सेल के कोने से वर्टिकल ऑफ़सेट. |
रिटर्न
OverGridImage
— शामिल की गई इमेज.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertImage(url, column, row)
दस्तावेज़ में किसी पंक्ति और कॉलम में इमेज डालता है.
दिया गया यूआरएल सार्वजनिक तौर पर उपलब्ध होना चाहिए.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; sheet.insertImage("https://www.google.com/images/srpr/logo3w.png", 1, 1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
url | String | इमेज का यूआरएल. |
column | Integer | ग्रिड कॉलम की जगह. |
row | Integer | ग्रिड की पंक्ति की जगह. |
रिटर्न
OverGridImage
— शामिल की गई इमेज.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertImage(url, column, row, offsetX, offsetY)
पिक्सल ऑफ़सेट के साथ दी गई पंक्ति और कॉलम में दस्तावेज़ में इमेज डालता है.
दिया गया यूआरएल सार्वजनिक तौर पर उपलब्ध होना चाहिए.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; sheet.insertImage("https://www.google.com/images/srpr/logo3w.png", 1, 1, 10, 10);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
url | String | इमेज के लिए यूआरएल. |
column | Integer | कॉलम की स्थिति. |
row | Integer | पंक्ति की जगह. |
offsetX | Integer | पिक्सल में सेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट. |
offsetY | Integer | पिक्सल में सेल के कोने से वर्टिकल ऑफ़सेट. |
रिटर्न
OverGridImage
— डाली गई इमेज.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertRowAfter(afterPosition)
दी गई पंक्ति की जगह के बाद पंक्ति शामिल करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This inserts a row after the first row position sheet.insertRowAfter(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
afterPosition | Integer | वह लाइन जिसके बाद नई लाइन जोड़नी है. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertRowBefore(beforePosition)
दी गई पंक्ति की जगह से पहले पंक्ति शामिल करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This inserts a row before the first row position sheet.insertRowBefore(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
beforePosition | Integer | वह लाइन जिससे पहले नई लाइन जोड़नी है. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertRows(rowIndex)
किसी खास जगह पर, शीट में एक खाली पंक्ति शामिल करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Shifts all rows down by one sheet.insertRows(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | वह इंडेक्स जिससे पता चलता है कि लाइन कहां जोड़नी है. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertRows(rowIndex, numRows)
तय की गई जगह से शुरू होने वाली शीट में, एक या उससे ज़्यादा लगातार खाली पंक्तियां शामिल करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Shifts all rows down by three sheet.insertRows(1, 3);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | वह इंडेक्स जिससे पता चलता है कि लाइन कहां जोड़नी है. |
numRows | Integer | डाली जाने वाली पंक्तियों की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertRowsAfter(afterPosition, howMany)
दी गई पंक्ति की जगह के बाद कई पंक्तियां शामिल करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This inserts five rows after the first row sheet.insertRowsAfter(1, 5);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
afterPosition | Integer | वह लाइन जिसके बाद नई लाइनें जोड़नी हैं. |
howMany | Integer | डाली जाने वाली पंक्तियों की संख्या. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
insertRowsBefore(beforePosition, howMany)
दी गई पंक्ति की जगह से पहले कई पंक्तियां शामिल करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This inserts five rows before the first row sheet.insertRowsBefore(1, 5);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
beforePosition | Integer | वह लाइन जिससे पहले नई लाइनें जोड़नी हैं. |
howMany | Integer | डाली जाने वाली पंक्तियों की संख्या. |
रिटर्न
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);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
range | Range | वह रेंज जिस पर स्लाइसर बनाया गया है. |
anchorRowPos | Integer | स्लाइसर के ऊपरी हिस्से को इस लाइन में ऐंकर किया जाता है. |
anchorColPos | Integer | स्लाइसर के ऊपरी हिस्से को इस कॉल में ऐंकर किया जाता है. |
रिटर्न
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);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
range | Range | वह रेंज जिस पर स्लाइसर बनाया गया है. |
anchorRowPos | Integer | स्लाइसर के ऊपरी हिस्से को इस लाइन में ऐंकर किया जाता है. |
anchorColPos | Integer | स्लाइसर के ऊपरी हिस्से को इस कॉल में ऐंकर किया जाता है. |
offsetX | Integer | पिक्सल में सेल के कोने से हॉरिज़ॉन्टल ऑफ़सेट. |
offsetY | Integer | पिक्सल में सेल के कोने से वर्टिकल ऑफ़सेट. |
रिटर्न
Slicer
— डाला गया नया स्लाइसर.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isColumnHiddenByUser(columnPosition)
यह दिखाता है कि उपयोगकर्ता ने कॉलम छिपाया है या नहीं.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Columns start at 1 Logger.log(sheet.isColumnHiddenByUser(1));
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | जांच किए जाने वाले कॉलम की जगह. |
रिटर्न
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());
रिटर्न
Boolean
— दाएं से बाएं होने पर true
. अगर ऐसा नहीं है, तो false
होता है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isRowHiddenByFilter(rowPosition)
यह दिखाता है कि दी गई पंक्ति किसी फ़िल्टर (फ़िल्टर व्यू नहीं) से छिपी हुई है या नहीं.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Rows start at 1 Logger.log(sheet.isRowHiddenByFilter(1));
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowPosition | Integer | जांच करने के लिए पंक्ति की जगह. |
रिटर्न
Boolean
— अगर लाइन छिपी हुई है, तो true
. अगर ऐसा नहीं है, तो false
.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isRowHiddenByUser(rowPosition)
यह दिखाता है कि उपयोगकर्ता ने दी गई पंक्ति को छिपाया है या नहीं.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Rows start at 1 Logger.log(sheet.isRowHiddenByUser(1));
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowPosition | Integer | जांच करने के लिए पंक्ति की जगह. |
रिटर्न
Boolean
— अगर लाइन छिपी हुई है, तो true
. अगर ऐसा नहीं है, तो false
.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isSheetHidden()
अगर शीट फ़िलहाल छिपी हुई है, तो true
दिखाता है.
var 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. var sheet = SpreadsheetApp.getActiveSheet(); // Selects column A and column B to be moved. var columnSpec = sheet.getRange("A1:B1"); sheet.moveColumns(columnSpec, 5);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnSpec | Range | उन कॉलम में फैली रेंज जिसे दूसरी जगह ले जाना है. |
destinationIndex | Integer | वह इंडेक्स जहां कॉलम को ले जाना है. ध्यान दें कि कॉलम को दूसरी जगह ले जाने से पहले, यह इंडेक्स निर्देशांक पर आधारित होता है. सोर्स कॉलम को ग्रिड से हटाए जाने पर, मौजूदा डेटा को दाईं ओर शिफ़्ट कर दिया जाता है, ताकि दूसरी जगह ले जाए गए कॉलम के लिए जगह बनाई जा सके. इसलिए, डेटा मूल रूप से तय किए गए इंडेक्स से अलग इंडेक्स पर मिल सकता है. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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. var sheet = SpreadsheetApp.getActiveSheet(); // Selects row 1 and row 2 to be moved. var rowSpec = sheet.getRange("A1:A2"); sheet.moveRows(rowSpec, 5);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowSpec | Range | उन पंक्तियों में फैली हुई रेंज जिन्हें एक से दूसरी जगह ले जाना चाहिए. |
destinationIndex | Integer | वह इंडेक्स जहां पंक्तियों को ले जाना है. ध्यान दें कि यह इंडेक्स, पंक्तियों को दूसरी जगह ले जाने से पहले कोऑर्डिनेट पर आधारित होता है. मौजूदा डेटा को नीचे की ओर शिफ़्ट किया जाता है, ताकि सोर्स की लाइनों को ग्रिड से हटाए जाने के दौरान, एक जगह से दूसरी जगह ले जाने वाली लाइनों के लिए जगह बनाई जा सके. इसलिए, हो सकता है कि डेटा मूल रूप से तय किए गए इंडेक्स से अलग इंडेक्स पर दिखे. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
newChart()
इस शीट के लिए नया चार्ट बनाने के लिए बिल्डर दिखाता है.
इस उदाहरण में, नया चार्ट बनाने का तरीका बताया गया है:
var sheet = SpreadsheetApp.getActiveSheet(); var range = sheet.getRange("A1:B8"); var 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. var sheet = SpreadsheetApp.getActiveSheet(); var 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. var 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)
पैरंट शीट से चार्ट हटाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This removes all the embedded charts from the spreadsheet var charts = sheet.getCharts(); for (var i in charts) { sheet.removeChart(charts[i]); }
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
chart | EmbeddedChart | हटाया जाने वाला चार्ट. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setActiveRange(range)
तय की गई रेंज को चालू शीट में active range
के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर बाईं ओर मौजूद सेल को current cell
के तौर पर सेट करता है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var range = sheet.getRange('A1:D4'); sheet.setActiveRange(range); var selection = sheet.getSelection(); // Current cell: A1 var currentCell = selection.getCurrentCell(); // Active Range: A1:D4 var activeRange = selection.getActiveRange();
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
range | Range | सक्रिय श्रेणी के रूप में सेट की जाने वाली श्रेणी. |
रिटर्न
Range
— चालू की गई नई रेंज
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setActiveRangeList(rangeList)
यह ऐक्टिव शीट में रेंज की सूची को active ranges
के तौर पर सेट करता है. सूची में आखिरी रेंज को active range
के तौर पर सेट किया गया है.
var sheet = SpreadsheetApp.getActiveSheet(); var rangeList = sheet.getRangeList(['D4', 'B2:C4']); sheet.setActiveRangeList(rangeList); var selection = sheet.getSelection(); // Current cell: B2 var currentCell = selection.getCurrentCell(); // Active range: B2:C4 var activeRange = selection.getActiveRange(); // Active range list: [D4, B2:C4] var activeRangeList = selection.getActiveRangeList();
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rangeList | RangeList | चुनी जाने वाली रेंज की सूची. |
रिटर्न
RangeList
— चुनी गई नई रेंज की सूची
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setActiveSelection(range)
इस शीट के लिए चुने जाने का सक्रिय क्षेत्र सेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var range = sheet.getRange("A1:D4"); sheet.setActiveSelection(range);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
range | Range | सक्रिय चुनाव के रूप में सेट की जाने वाली श्रेणी. |
रिटर्न
Range
— चालू की गई नई रेंज
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setActiveSelection(a1Notation)
A1 नोटेशन या R1C1 नोटेशन में बताए गए तरीके के हिसाब से, ऐक्टिव सिलेक्शन सेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; sheet.setActiveSelection("A1:D4");
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
a1Notation | String | वह रेंज जिसे A1 संकेतन या R1C1 संकेतन के तौर पर सक्रिय के तौर पर सेट किया जाना है. |
रिटर्न
Range
— चालू की गई नई रेंज
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setColumnGroupControlPosition(position)
शीट पर कॉलम ग्रुप कंट्रोल टॉगल की जगह सेट करता है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; sheet.setColumnGroupControlPosition(SpreadsheetApp.GroupControlTogglePosition.AFTER);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
position | GroupControlTogglePosition | कॉलम ग्रुप के कंट्रोल के टॉगल की जगह. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setColumnWidth(columnPosition, width)
दिए गए कॉलम की चौड़ाई को पिक्सल में सेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sets the first column to a width of 200 pixels sheet.setColumnWidth(1, 200);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | सेट किए जाने वाले कॉलम की स्थिति. |
width | Integer | पिक्सल में चौड़ाई, जिसे सेट करना है. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setColumnWidths(startColumn, numColumns, width)
दिए गए कॉलम की चौड़ाई को पिक्सल में सेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sets the first three columns to a width of 200 pixels sheet.setColumnWidths(1, 3, 200);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
startColumn | Integer | शुरुआती कॉलम की जगह बदली जानी है. |
numColumns | Integer | बदले जाने वाले कॉलम की संख्या. |
width | Integer | पिक्सल में चौड़ाई, जिसे सेट करना है. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setConditionalFormatRules(rules)
शीट में मौजूद कंडिशनल फ़ॉर्मैट के सभी मौजूदा नियमों को इनपुट नियमों से बदलता है. नियमों का मूल्यांकन उनके इनपुट क्रम के हिसाब से किया जाता है.
// Remove one of the existing conditional format rules. var sheet = SpreadsheetApp.getActiveSheet(); var rules = sheet.getConditionalFormatRules(); rules.splice(1, 1); // Deletes the 2nd format rule. sheet.setConditionalFormatRules(rules);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rules | ConditionalFormatRule[] | शर्त के साथ फ़ॉर्मैटिंग के नए नियम. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setCurrentCell(cell)
बताए गए सेल को current cell
के तौर पर सेट करता है.
अगर कोई सेल पहले से चुनी गई किसी रेंज में मौजूद है, तो वह रेंज मौजूदा सेल के तौर पर सेल वाली सक्रिय रेंज बन जाती है.
अगर तय की गई सेल किसी भी चुनी गई रेंज में मौजूद नहीं है, तो चुने गए सभी मौजूदा सेल हटा दिए जाते हैं और सेल, मौजूदा सेल और सक्रिय रेंज बन जाती है.
ध्यान दें: दिए गए Range
में सिर्फ़ एक सेल होनी चाहिए. ऐसा न होने पर, अपवाद के तौर पर एक सेल ही दिखेगी.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var cell = sheet.getRange('B5'); sheet.setCurrentCell(cell); var selection = sheet.getSelection(); // Current cell: B5 var currentCell = selection.getCurrentCell();
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
cell | Range | मौजूदा सेल के तौर पर सेट किया जाने वाला सेल. |
रिटर्न
Range
— नया सेट किया गया मौजूदा सेल
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFrozenColumns(columns)
कॉलम की दी गई संख्या को फ़्रीज़ करता है. अगर शून्य है, तो कोई भी कॉलम फ़्रीज़ नहीं किया गया है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Freezes the first column sheet.setFrozenColumns(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columns | Integer | फ़्रीज़ किए जाने वाले कॉलम की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFrozenRows(rows)
पंक्तियों की दी गई संख्या को फ़्रीज़ करता है. अगर शून्य है, तो कोई भी पंक्ति फ़्रीज़ नहीं की गई है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Freezes the first row sheet.setFrozenRows(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rows | Integer | फ़्रीज़ की जाने वाली पंक्तियों की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
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);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
hideGridlines | Boolean | अगर 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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("first"); first.setName("not first anymore");
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
name | String | शीट का नया नाम. |
रिटर्न
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);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rightToLeft | Boolean | अगर शीट का लेआउट true है, तो यह दाएं से बाएं कोने में, सेल A1 पर सबसे ऊपर दाएं कोने पर सेट होता है. अगर false , तो शीट लेआउट सबसे ऊपर बाईं ओर, सेल A1 के साथ डिफ़ॉल्ट
बाएं से दाएं सेट होता है. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRowGroupControlPosition(position)
शीट पर लाइन ग्रुप कंट्रोल टॉगल की जगह सेट करता है.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; sheet.setRowGroupControlPosition(SpreadsheetApp.GroupControlTogglePosition.AFTER);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
position | GroupControlTogglePosition | लाइन ग्रुप कंट्रोल टॉगल की जगह. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRowHeight(rowPosition, height)
किसी पंक्ति की ऊंचाई को पिक्सल में सेट करता है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियां बढ़ती जाती हैं. अगर
आपको पंक्तियों को तय ऊंचाई पर लागू करना है, तो setRowHeightsForced(startRow, numRows, height)
का इस्तेमाल करें.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sets the first row to a height of 200 pixels sheet.setRowHeight(1, 200);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowPosition | Integer | पंक्ति की जगह बदलें. |
height | Integer | पिक्सल में वह ऊंचाई जिस पर सेट करना है. |
रिटर्न
Sheet
— यह शीट, मेथड चेन में काम की है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRowHeights(startRow, numRows, height)
दी गई पंक्तियों की ऊंचाई पिक्सल में सेट करता है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियां बढ़ती जाती हैं. अगर
आपको पंक्तियों को तय ऊंचाई पर लागू करना है, तो setRowHeightsForced(startRow, numRows, height)
का इस्तेमाल करें.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sets the first three rows to a height of 20 pixels sheet.setRowHeights(1, 3, 20);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
startRow | Integer | शुरुआती पंक्ति की जगह बदलना है. |
numRows | Integer | बदली जाने वाली पंक्तियों की संख्या. |
height | Integer | पिक्सल में वह ऊंचाई जिस पर सेट करना है. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRowHeightsForced(startRow, numRows, height)
दी गई पंक्तियों की ऊंचाई पिक्सल में सेट करता है. डिफ़ॉल्ट रूप से, सेल के कॉन्टेंट के हिसाब से पंक्तियां बढ़ती जाती हैं. setRowHeightsForced
का इस्तेमाल करने पर, पंक्तियों को तय ऊंचाई पर ही लागू किया जाता है, भले ही सेल का कॉन्टेंट, पंक्ति की ऊंचाई से ज़्यादा हो.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sets the first three rows to a height of 5 pixels. sheet.setRowHeightsForced(1, 3, 5);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
startRow | Integer | शुरुआती पंक्ति की जगह बदलना है. |
numRows | Integer | बदली जाने वाली पंक्तियों की संख्या. |
height | Integer | पिक्सल में वह ऊंचाई जिस पर सेट करना है. |
रिटर्न
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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("first"); first.setTabColor("ff0000"); // Set the color to red. first.setTabColor(null); // Unset the color.
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
color | String | टैब का रंग रीसेट करने के लिए, सीएसएस नोटेशन में कोई कलर कोड (जैसे कि '#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" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("Sheet1"); var color = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1) .build(); first.setTabColorObject(color); // Set the color to theme accent 1. first.setTabColorObject(null); // Unset the color.
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
color | Color | शीट टैब का वह रंग जिसे सेट करना है. |
रिटर्न
Sheet
— यह शीट, चेन बनाने के लिए है.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
showColumns(columnIndex)
दिए गए इंडेक्स में कॉलम दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Unhides the first column sheet.showColumns(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | दिखाने के लिए कॉलम का इंडेक्स. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
showColumns(columnIndex, numColumns)
दिए गए इंडेक्स से शुरू होने वाले एक या ज़्यादा लगातार कॉलम को दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Unhides the first three columns sheet.showColumns(1, 3);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnIndex | Integer | दिखाने के लिए कॉलम का शुरुआती इंडेक्स. |
numColumns | Integer | दिखाए जाने वाले कॉलम की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
showRows(rowIndex)
दिए गए इंडेक्स में पंक्ति दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Unhides the first row sheet.showRows(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | दिखाई जाने वाली पंक्ति का इंडेक्स. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
showRows(rowIndex, numRows)
दिए गए इंडेक्स से शुरू होने वाली एक या ज़्यादा लगातार पंक्तियां दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Unhides the first three rows sheet.showRows(1, 3);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
rowIndex | Integer | दिखाई जाने वाली पंक्तियों का शुरुआती इंडेक्स. |
numRows | Integer | दिखाई जाने वाली पंक्तियों की संख्या. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
showSheet()
इस विकल्प की मदद से, शीट दिखती है. अगर शीट पहले से दिख रही है, तो इसका कोई असर नहीं होगा.
var sheet = SpreadsheetApp.getActiveSheet(); sheet.showSheet();
रिटर्न
Sheet
— मौजूदा शीट.
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
sort(columnPosition)
शीट को कॉलम के हिसाब से बढ़ते क्रम में लगाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sorts the sheet by the first column, ascending sheet.sort(1);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | क्रम से लगाने के लिए कॉलम. |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
sort(columnPosition, ascending)
शीट को कॉलम के हिसाब से क्रम में लगाता है. बढ़ते या घटते क्रम में तय करने के लिए पैरामीटर लेता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // Sorts the sheet by the first column, descending sheet.sort(1, false);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
columnPosition | Integer | क्रम से लगाने के लिए कॉलम. |
ascending | Boolean | बढ़ते क्रम में true और घटते क्रम में false . |
रिटर्न
Sheet
— शीट, मेथड चेन में काम की है
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
unhideColumn(column)
दी गई रेंज में कॉलम दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This unhides the first column if it was previously hidden var range = sheet.getRange("A1"); sheet.unhideColumn(range);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
column | Range | वह रेंज जिसे दिखाना है, अगर वह छिपा हुआ है. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
unhideRow(row)
दी गई रेंज में पंक्ति दिखाता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This unhides the first row if it was previously hidden var range = sheet.getRange("A1"); sheet.unhideRow(range);
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
row | Range | वह रेंज जिसे दिखाना है, अगर वह छिपा हुआ है. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
updateChart(chart)
इस शीट पर चार्ट अपडेट करता है.
var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; // This code is going to loop through all the charts and change them to // column charts var charts = sheet.getCharts(); for (var i in charts) { var chart = charts[i]; var newChart = chart .modify() .setChartType(Charts.ChartType.COLUMN) .build(); sheet.updateChart(newChart); }
पैरामीटर
नाम | टाइप | ब्यौरा |
---|---|---|
chart | EmbeddedChart | अपडेट किया जाने वाला चार्ट. |
अनुमति
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets