---
title: "data.validation: Data Validation — Sheet kit command — Kition"
description: "Sets a data validation rule on a range (whole number, decimal, list, date, time, text length or custom formula) with input and error messages."
canonical: "https://developer.kition.ai/docs/kits/sheet/commands/data.validation"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/sheet/commands/data.validation](https://developer.kition.ai/docs/kits/sheet/commands/data.validation)

# data.validation

**Data Validation.** Sets a data validation rule on a range (whole number, decimal, list, date, time, text length or custom formula) with input and error messages.

- Kit: Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb)); reference: [Sheet kit commands](https://developer.kition.ai/docs/kits/sheet.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `clear` | `boolean` | no |  |
| `dropdown` | `boolean` | no |  |
| `errorMessage` | `string` | no |  |
| `errorStyle` | `"stop" \| "warning" \| "information"` | no |  |
| `errorTitle` | `string` | no |  |
| `formula1` | `string \| number` | no |  |
| `formula2` | `string \| number` | no |  |
| `ignoreBlank` | `boolean` | no |  |
| `inputMessage` | `string` | no |  |
| `inputTitle` | `string` | no |  |
| `operator` | `"between" \| "notBetween" \| "equal" \| "notEqual" \| "greater" \| "less" \| "greaterOrEqual" \| "lessOrEqual"` | no |  |
| `range` | `string` | no | cells in A1 notation such as B2 or B2:D10, optionally with a sheet (Sheet2!A1); default: the selection |
| `showError` | `boolean` | no | default true |
| `showInput` | `boolean` | no | default true |
| `type` | `"any" \| "whole" \| "decimal" \| "list" \| "date" \| "time" \| "textLength" \| "custom"` | no |  |

## Call through sheet_run

```text
sheet_run {
  "path": "<file>.xlsx",
  "steps": [{ "command": "data.validation" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `clear`, `dropdown`, `errorMessage`, `errorStyle`, `errorTitle`, `formula1`, `formula2`, `ignoreBlank`, `inputMessage`, `inputTitle`, `operator`, `range`, `showError`, `showInput`, `type`. sheet_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "clear": {
      "type": "boolean"
    },
    "dropdown": {
      "type": "boolean"
    },
    "errorMessage": {
      "type": "string"
    },
    "errorStyle": {
      "enum": [
        "stop",
        "warning",
        "information"
      ],
      "type": "string"
    },
    "errorTitle": {
      "type": "string"
    },
    "formula1": {
      "oneOf": [
        {
          "description": "a value, a list such as a,b,c, or a =formula",
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    },
    "formula2": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    },
    "ignoreBlank": {
      "type": "boolean"
    },
    "inputMessage": {
      "type": "string"
    },
    "inputTitle": {
      "type": "string"
    },
    "operator": {
      "enum": [
        "between",
        "notBetween",
        "equal",
        "notEqual",
        "greater",
        "less",
        "greaterOrEqual",
        "lessOrEqual"
      ],
      "type": "string"
    },
    "range": {
      "description": "cells in A1 notation such as B2 or B2:D10, optionally with a sheet (Sheet2!A1); default: the selection",
      "type": "string"
    },
    "showError": {
      "description": "default true",
      "type": "boolean"
    },
    "showInput": {
      "description": "default true",
      "type": "boolean"
    },
    "type": {
      "enum": [
        "any",
        "whole",
        "decimal",
        "list",
        "date",
        "time",
        "textLength",
        "custom"
      ],
      "type": "string"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/sheet-darwin-arm64@0.1.0 and the kit itself (sheet_commands through @kition/cli@0.1.1, built from KitionAI/kition-sheet@82f13b2).
