Skip to content

Function: makeMetadataFormula()

makeMetadataFormula<ContextT, ReturnT>(execute, options?): MetadataFormula<ContextT, ReturnT>

Defined in: api.ts:1998

A wrapper that generates a formula definition from the function that implements a metadata formula. It is uncommon to ever need to call this directly, normally you would just define the JavaScript function implementation, and Coda will wrap it with this to generate a full metadata formula definition.

All function-like behavior in a pack is ultimately implemented using formulas, like you would define using makeFormula. That is, a formula with a name, description, parameter list, and an execute function body. This includes supporting utilities like parameter autocomplete functions. This wrapper simply adds the surrounding boilerplate for a given JavaScript function so that it is shaped like a Coda formula to be used at runtime.

Type Parameters

Type Parameter Default type
ContextT extends ExecutionContext -
ReturnT extends PackFormulaResult LegacyDefaultMetadataReturnType

Parameters

Parameter Type
execute MetadataFunction<ContextT, ReturnT>
options? { connectionRequirement?: ConnectionRequirement; }
options.connectionRequirement? ConnectionRequirement

Returns

MetadataFormula<ContextT, ReturnT>