variable.getName()

Retrieves the name of the variable.

Syntax

1variable.getName(): Promise<string>;

Returns

Promise<string>

A Promise that resolves to a string with the variable name

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.getName()

Designer Ability

Checks for Authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canReadVariablesAnyAnyAnyAny