variable.get()

Retrieves the value of the variable.

Syntax

1variable.get(): Promise< Value: string | Variable | SizeValue>>;

Returns

Variable TypeReturn Value
ColorVariablePromise<string | Variable>
SizeVariablePromise<SizeValue > - { value: number, unit: SizeUnit} | Variable
FontFamilyVariablePromise<string | Variable>

A Promise that resolves to the value of the variable, which depends on the variable type.

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

Designer Ability

Checks for Authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canReadVariablesAnyAnyAnyAny