Designer API
Control the Webflow Designer
collection.getVariableByName(name)
Retrieve a variable by its name.
1collection.getVariableByName(name: string): 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 Name5const variableByName = await collection?.getVariableByName('Space Cadet')6console.log(variableByName)
Try this example
Checks for Authorization only