variable.get()
variable.get()
Retrieves the value of the variable.
Syntax
variable.get(): Promise< Value: string | Variable | SizeValue>>;
Returns
Variable Type | Return Value |
---|---|
ColorVariable | Promise<string | Variable> |
SizeVariable | Promise<SizeValue > - { value: number, unit: SizeUnit} | Variable |
FontFamilyVariable | Promise<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()
Designer Ability
Checks for Authorization only
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canReadVariables | Any | Any | Any | Any |