collection.createNumberVariable(name, value)

Create a number variable with a name and value for the variable.

Syntax

1collection.createNumberVariable(name: string,value: number | NumberVariable): Promise<NumberVariable>

Parameters

  • name : string - Name of the variable
  • value: number - Value of the variable.

Returns

Promise<NumberVariable>

A Promise that resolves to a NumberVariable object.

Example

1// Get Collection
2const collection = await webflow.getDefaultVariableCollection()
3
4// Create Number Variable of 50
5const myNumberVariable = await collection?.createNumberVariable("small", 50)
6console.log(myNumberVariable)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyVariablesAnyMainCanvasDesign