variable.setName(name)

Sets the name of the variable.

Syntax

1variable.setName(name: string): Promise<null>;

Parameters

  • name : string - Name of the variable

Returns

Promise<null>

A Promise that resolves to null.

Example

1// Get Collection
2const collection = await webflow.getDefaultVariableCollection()
3
4// Get All Variables
5const variables = await collection.getAllVariables()
6
7// Get Value of first Variable
8const variable = variables[0]
9const value = await variable.setName("Primary")

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyVariablesAnyMainCanvasDesign