Skip to content

excel pivottable get

zmworm edited this page Apr 29, 2026 · 56 revisions

Excel: Pivot Table - get

Get pivot table properties and field configuration.

Path: /{SheetName}/pivottable[N]

Attributes

Attribute Type Description
name string Pivot table name
cacheId number Cache definition ID
location string Cell range where the pivot table is placed
fieldCount number Total number of fields
rows string Comma-separated list of row field names
cols string Comma-separated list of column field names
filters string Comma-separated list of filter field names
dataFieldCount number Number of data (value) fields
dataField1..dataFieldN string Data field info, format: name:func:fieldIdx (e.g. Sum of Sales:sum:2)
dataField{N}.showAs string Optional showAs token (e.g. percent_of_row)
grandTotals string Grand total visibility: both | rows | cols | none
subtotals string Subtotal rows for row/col fields: on | off
repeatLabels bool Repeat outer row labels on every row (only present when true)
blankRows bool Blank line after each outer group (only present when true)
grandTotalCaption string Grand total label (only present when non-default)
style string Applied pivot table style name
showRowHeaders bool Row headers visible (default true)
showColHeaders bool Column headers visible (default true)
showRowStripes bool Row banding/stripes enabled (default false)
showColStripes bool Column banding/stripes enabled (default false)
showLastColumn bool Special formatting on last column (default true)

Examples

# Get pivot table properties
officecli get data.xlsx /Sheet1/pivottable[1]
/Sheet1/pivottable[1]
  name: SalesPivot
  cacheId: 1
  location: H1:K15
  fieldCount: 5
  rows: Region,Category
  cols: Year
  filters: Status
  dataFieldCount: 2
  dataField1: Sum of Sales:sum:3
  dataField2: Count of Qty:count:4
  style: PivotStyleMedium9
# Get as JSON
officecli get data.xlsx /Sheet1/pivottable[1] --json

See Also


Based on OfficeCLI v1.0.64

Clone this wiki locally