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
    • Variable Modes
  • Assets
      • Get Asset Name
      • Set Asset Name
      • Get Alt Text
      • Set Alt Text
      • Set Asset File
      • Get Asset MIME Type
      • Get Asset URL
      • Get folder of Asset
      • Set folder for Asset
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • Asset.getParent()
AssetsManaging Assets

Get folder of an Asset

Was this page helpful?
Previous

Set folder for an Asset

Next
Built with

Asset.getParent()

Gets the folder of the current Asset in the Webflow Designer

Syntax

1Asset.getParent(): Promise<AssetFolder | null>

Returns

AssetFolder | null

A Promise that resolves to the parent Asset folder, or null if a parent folder does not exist for the Asset.

Example

1// Get all Assets
2const assets = await webflow.getAllAssets()
3const asset = assets[0]
4
5const folder = await asset.getParent()
6
7if (folder) {
8 console.log(folder)
9} else {
10 console.log("A parent folder does not exist for this asset")
11}

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessAssetsAnyAnyAnyAny