Managing Sheet with APIs

SheetAPI.addFilter2Span



addFilter2Span( hd, span, filterCdts, persist )

SheetAPI.addFilter2Span method is used to add filter to a range of selected cells with the specific condition.

Parameters The handle information of the Sheet application your created. In general, it is SHEET_API_HD The specific array list to be applied filter.
[sheetId, startRow, startCol, endRow, endCol]
    
    startRow: should be >=1. 1 means first row for the selected sheet.
    startCol: should be >=1. 1 means first column (column A) for the selected sheet.
    endRow: should be more than startRow or zero. If the value is zero, it means all cells below the startRow are selected.
    endCol: should be more than or equal startCol.
    
which define the specific sheetId and a range of cells which need to be added filter.
6 : {
   'type': 'match',
   'values': ['apple', 'pear']
},
7 : {
   'type': 'match',
   'values': ['test']
}

    6 means column number 6 (cloumn F) will be applied the listed condition.

Example code to apply filter to the cells


SHEET_API.addFilter2Span(SHEET_API_HD, [SHEET_API_HD.sheet.getSheetId(), 3, 6, 0, 7], {
	6 : {
		'type': 'match',
		'values': ['test']
	},
	7 : {
		'type': 'match',
		'values': ['ok']
	}
}, false);
    

 

 


Copyright © FeyaSoft Inc. All rights reserved.