Get folder of an Asset

Asset.getParent()

Gets the folder of the current Asset in the Webflow Designer

Syntax

Asset.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

// Get all Assets
const assets = await webflow.getAllAssets()
const asset = assets[0]
const folder = await asset.getParent()
if (folder) {
console.log(folder)
} else {
console.log("A parent folder does not exist for this asset")
}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessAssetsAnyAnyAnyAny