APIsChangelog
Log In

Get variable value

variable.get()

Retrieves the value of the variable.

Syntax

variable.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

// Get Collection
const collection = await webflow.getDefaultVariableCollection();

// Get All Variables
const variables = await collection.getAllVariables();

// Get Value of first Variable
const variable = variables[0];
const value = await variable.get()