Context

The context object of the custom JavaScript functions (primitives) in formulas.

Constructors

Context

()

Methods

asMatrix

Converts the given argument to a matrix, if possible. It accepts a RangeRef object or a plain JavaScript non-empty array. Additionally, if a Matrix object is provided, it is returned as is.

Parameters

arg

Matrix | RangeRef | RangeRef[]

Returns

Matrix

cellValues

Returns as a flat array the values in any reference that exist in the given array. Elements that are not references are copied over.

Parameters

array

Ref | Matrix | undefined[]

Returns

any

getRefData

Returns the data that is the value in the given reference. If a CellRef is given, it returns a single value. For a RangeRef or UnionRef, it returns a flat array of values.

Parameters

ref

RangeRef | CellRef | UnionRef

Returns

any

resolveCells

Verifies that all references in the given array are resolved before invoking your callback—that is, executes any formula. If this array turns out to include the cell where the current formula lives, it returns a #CIRCULAR! error. Elements that are not references are ignored.

Parameters

array

Ref[] | Ref[][]

callback

() => any

Returns

any

workbook

Returns the Workbook object where the current formula is evaluated.

Returns

Workbook