Sheet kit command

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))
Changes the document
yes

Parameters

Parameters of data.validation
NameTypeRequiredDescription
clearbooleanno
dropdownbooleanno
errorMessagestringno
errorStyle"stop" | "warning" | "information"no
errorTitlestringno
formula1string | numberno
formula2string | numberno
ignoreBlankbooleanno
inputMessagestringno
inputTitlestringno
operator"between" | "notBetween" | "equal" | "notEqual" | "greater" | "less" | "greaterOrEqual" | "lessOrEqual"no
rangestringnocells in A1 notation such as B2 or B2:D10, optionally with a sheet (Sheet2!A1); default: the selection
showErrorbooleannodefault true
showInputbooleannodefault 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/[email protected] and the kit itself (sheet_commands through @kition/[email protected], built from KitionAI/kition-sheet@82f13b2). As data: commands.jsonl.