Filter the range using a condition.
Optionalcondition: Input<any>Optionaloptions: ITransaction.OperationOptionsResolves once the rows are hidden.
Examples:
keep only values greater than or equal to 30:
sheet.getRange('E:E').filter({
operator: ICondition.BuiltInOperatorNames.GreaterThanOrEqual,
param: 30
});
Example 2 – function param
sheet.getRange('E:E').filter(value => value >= 30);
// or with context: (e.g., to ignore header row)
sheet.getRange('E:E').filter((value, ctx) => {
const { rowIndex } = ctx.getCoords();
return rowIndex > 1 && value >= 30;
});
Example 3 – string
The expression is parsed using the same rules as user input
(e.g., "30" is a number, "=A1*2" is a formula, "40%" is 0.4).
sheet.getRange('E:E').filter('>= 30');
Interface indicating the ability to filter data.