# SheetValidation Class

> SheetValidation class in the Node.js JavaScript API: Sheet-bound validation rules and inspection. Includes the syntax and a JavaScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > JavaScript API > Node.js Server > SheetValidation Class
- **941 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/llms-full.txt

---

Sheet-bound validation rules and inspection. Existing values remain unchanged when a rule is installed.

Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

### Constructor

```javascript
new SheetValidation(sheet)
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `sheet` | `Worksheet` | No | Value matching sheet's declared type and the owning object's validation rules. |

Returns: `SheetValidation`.

### Members

#### Properties

| Property | Description |
|---|---|
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/sheet-property/llms-full.txt) | The sheet value of SheetValidation. |

#### Methods

| Method | Description |
|---|---|
| [check](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/check-method/llms-full.txt) | Checks the current value without modifying the cell or showing a dialog. |
| [choices](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/choices-method/llms-full.txt) | Returns list choices for a cell, including names and range-based lists. |
| [list](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/list-method/llms-full.txt) | Returns detached definitions in their enforcement order. |
| [remove](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/remove-method/llms-full.txt) | Removes rules by identity, or all rules when no identity is supplied. |
| [set](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/set-method/llms-full.txt) | Replaces rules on an exact target range; subsequent edits are checked atomically. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```javascript
function createSheetValidationReport(control) {
    const book = control.workbook;
    const sheet = book.sheets.at(0);
    sheet.cell('A1').setText('October invoice');
    sheet.cell('A1').format({
        fontFamily: 'Liberation Sans',
        fontSize: 16,
        bold: true,
        textColor: '#ffffff',
        fillColor: '#163b63',
    });

    sheet.columns.at(0).setWidth({ pixels: 240 });
    sheet.range('B8:B9').setValues([[120], [80]]);
    sheet.cell('B10').setFormula('=SUM(B8:B9)');
    sheet.range('B8:B10').format({ numberFormatCode: '#,##0.00', fontSize: 11 });
    sheet.validation.set('B8:B9', { type: 'decimal', operator: 'between', formula1: '0', formula2: '10000' });
    return sheet;
}
```

### See Also

- [JavaScript Node.js Server API](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/llms-full.txt)
- [Data Validation](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/validation/llms-full.txt)

---

## In This Section

- [SheetValidation.check Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/check-method/llms-full.txt): SheetValidation.check method in the TX Sheet Control JavaScript API for Node.js: Checks the current value without modifying the cell or showing a dialog.
- [SheetValidation.choices Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/choices-method/llms-full.txt): SheetValidation.choices method in the TX Sheet Control JavaScript API for Node.js: Returns list choices for a cell, including names and range-based lists.
- [SheetValidation.list Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/list-method/llms-full.txt): SheetValidation.list method in the TX Sheet Control JavaScript API for Node.js: Returns detached definitions in their enforcement order.
- [SheetValidation.remove Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/remove-method/llms-full.txt): SheetValidation.remove method in the TX Sheet Control JavaScript API for Node.js: Removes rules by identity, or all rules when no identity is supplied.
- [SheetValidation.set Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/set-method/llms-full.txt): SheetValidation.set method in the TX Sheet Control JavaScript API for Node.js: Replaces rules on an exact target range; subsequent edits are checked atomically.
- [SheetValidation.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/sheet-property/llms-full.txt): SheetValidation.sheet property in the TX Sheet Control JavaScript API for Node.js, with its type Worksheet and a JavaScript example.

---

## Nearby

- **Previous:** [SheetProtection.unprotect Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetprotection/unprotect-method/llms-full.txt)
- **Next:** [SheetValidation.check Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/sheetvalidation/check-method/llms-full.txt)
