Designer API
Control the Webflow Designer
variable.setName(name)
Sets the name of the variable.
1variable.setName(name: string): Promise<null>;
Promise<null>
null
A Promise that resolves to null.
1// Get Collection2const collection = await webflow.getDefaultVariableCollection()34// Get All Variables5const variables = await collection.getAllVariables()67// Get Value of first Variable8const variable = variables[0]9const value = await variable.setName("Primary")
Try this example