ws.validation
WorksheetValidation
Sub-API for data validation operations on a worksheet.
8 methods
set
→ Promise<ValidationSetReceipt>set(address: string, rule: ValidationRule): Promise<ValidationSetReceipt>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
| rule | ValidationRule | required |
Set a validation rule on a cell or range. @param address - A1-style cell or range address (e.g. "A1", "A1:B5") @param rule - Validation rule to apply
remove
→ Promise<ValidationRemoveReceipt>remove(address: string): Promise<ValidationRemoveReceipt>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Remove validation from a cell (deletes any range schema covering the cell). @param address - A1-style cell address
get
→ Promise<ValidationRule | null>get(address: string): Promise<ValidationRule | null>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get the validation rule for a cell. @param address - A1-style cell address @returns The validation rule, or null if none
getDropdownItems
→ Promise<string[]>getDropdownItems(address: string): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get dropdown items for a cell with list validation. @param address - A1-style cell address @returns Array of dropdown item strings
list
→ Promise<ValidationRule[]>list(): Promise<ValidationRule[]>;List all validation rules on the sheet. @returns Array of validation rules
clear
→ Promise<void>clear(range: string): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Clear validation rules that overlap a range. @param range - A1-style range string (e.g. "A1:B5")
delete
→ Promise<void>delete(id: string): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| id | string | required |
Delete a validation rule by its ID. @param id - Validation rule / range schema ID
getErrorsInRange
→ Promise<Array<{ row: number; col: number }>>getErrorsInRange(
startRow: number,
startCol: number,
endRow: number,
endCol: number,
): Promise<Array<{ row: number; col: number }>>;| Parameter | Type | Required |
|---|---|---|
| startRow | number | required |
| startCol | number | required |
| endRow | number | required |
| endCol | number | required |
Get cells with validation errors in a range. @param startRow - Start row (0-based) @param startCol - Start column (0-based) @param endRow - End row (0-based) @param endCol - End column (0-based) @returns Array of {row, col} for cells with errors