Sheet kit command

data.filterValues

Filter Values

Answers what a filter button's list shows for its column (the sheet's AutoFilter or a table's): the distinct values in sort order with how many rows hold each and whether they show, the blanks apart, the kind of values (text, number, date) and the column's criterion. Changes nothing.

Kit
Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb))
Changes the document
no

Parameters

Parameters of data.filterValues
NameTypeRequiredDescription
cellstringnoa filter's header cell in A1 notation such as B3 (or a cell under it); default: the active cell

Call through sheet_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: cell. sheet_run answers the step’s result in completed[i].result.

Result

Result of data.filterValues
NameTypeRequiredDescription
columnstringno
kind"text" | "number" | "date"no
rangestringno
valuesobject[]no
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "column": {
      "type": "string"
    },
    "kind": {
      "enum": [
        "text",
        "number",
        "date"
      ],
      "type": "string"
    },
    "range": {
      "type": "string"
    },
    "values": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "checked": {
            "type": "boolean"
          },
          "count": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "cell": {
      "description": "a filter's header cell in A1 notation such as B3 (or a cell under it); default: the active cell",
      "type": "string"
    }
  },
  "returns": "{range, table, column, header, kind: text|number|date, values: [{text, count, checked}], blanks: {count, checked}|null, criterion, filtered: [columns]}: what a filter button's list shows",
  "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.