For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
        • Set variable value
        • Get variable value
        • Get variable name
        • Set variable name
        • Get variable binding
        • Get variable CSS name
        • Remove variable
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • variable.getName()
  • Syntax
  • Returns
  • Example
  • Designer Ability
Variables & CollectionsVariablesManaging Variables

Get variable name

Was this page helpful?
Previous

Set variable name

Next
Built with

variable.getName()

Retrieves the name of the variable.

Syntax

1variable.getName(): Promise<string>;

Returns

Promise<string>

A Promise that resolves to a string with the variable name

Example

1// Get Collection
2const collection = await webflow.getDefaultVariableCollection()
3
4// Get All Variables
5const variables = await collection.getAllVariables()
6
7// Get Value of first Variable
8const variable = variables[0]
9const value = await variable.getName()

Try this example

Designer Ability

Checks for Authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canReadVariablesAnyAnyAnyAny