Designer API
Control the Webflow Designer
Asset.getParent()
Gets the folder of the current Asset in the Webflow Designer
1Asset.getParent(): Promise<AssetFolder | null>
AssetFolder | null
AssetFolder
null
A Promise that resolves to the parent Asset folder, or null if a parent folder does not exist for the Asset.
1// Get all Assets2const assets = await webflow.getAllAssets()3const asset = assets[0]45const folder = await asset.getParent()67if (folder) {8 console.log(folder)9} else {10 console.log("A parent folder does not exist for this asset")11}
Try this example