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
| 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/[email protected] and the kit itself (sheet_commands through @kition/[email protected], built from KitionAI/kition-sheet@82f13b2). As data: commands.jsonl.