Designer API
Control the Webflow Designer
collection.getVariable(id)
Retrieve a variable by its ID.
1collection.getVariable(id: VariableId): Promise<null | Variable>
Promise<Variable | null>
null
A promise that resolves to a Variable object, or null if not found
1// Get Collection2const collection = await webflow.getDefaultVariableCollection()34// Get variable by ID5const variableById = await collection?.getVariable('id-123')6console.log(variableById)
Try this example
Checks for Authorization only