Skip to content
Mog is in active development. The GitHub repo, SDK packages, and community channels are not yet available. Follow for launch updates

wb.slicers

WorkbookSlicers

Sub-API for workbook-scoped slicer operations.

8 methods

list

Promise<SlicerInfo[]>
list(): Promise<SlicerInfo[]>;

List all slicers across all sheets in the workbook. @returns Array of slicer summary information

get

Promise<Slicer | null>
get(slicerId: string): Promise<Slicer | null>;
ParameterTypeRequired
slicerIdstringrequired

Get a slicer by ID from any sheet. @param slicerId - ID of the slicer @returns Full slicer state, or null if not found

getItemAt

Promise<SlicerInfo | null>
getItemAt(index: number): Promise<SlicerInfo | null>;
ParameterTypeRequired
indexnumberrequired

Get a slicer by its zero-based index in the list. @param index - Zero-based index of the slicer @returns Slicer summary information, or null if index is out of range

getItems

Promise<SlicerItem[]>
getItems(slicerId: string): Promise<SlicerItem[]>;
ParameterTypeRequired
slicerIdstringrequired

Get the items (values) available in a slicer by ID. @param slicerId - ID of the slicer @returns Array of slicer items with selection state

getItem

Promise<SlicerItem>
getItem(slicerId: string, key: CellValue): Promise<SlicerItem>;
ParameterTypeRequired
slicerIdstringrequired
keyCellValuerequired

Get a slicer item by its string key. @param slicerId - ID of the slicer @param key - The value to look up (matched via string coercion) @returns The matching slicer item @throws KernelError if no item matches the key

getItemOrNullObject

Promise<SlicerItem | null>
getItemOrNullObject(slicerId: string, key: CellValue): Promise<SlicerItem | null>;
ParameterTypeRequired
slicerIdstringrequired
keyCellValuerequired

Get a slicer item by its string key, or null if not found. @param slicerId - ID of the slicer @param key - The value to look up (matched via string coercion) @returns The matching slicer item, or null if not found

remove

Promise<void>
remove(slicerId: string): Promise<void>;
ParameterTypeRequired
slicerIdstringrequired

Remove a slicer by ID from any sheet. @param slicerId - ID of the slicer to remove

getCount

Promise<number>
getCount(): Promise<number>;

Get the total count of slicers across all sheets. @returns Number of slicers in the workbook