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.setParent(assetFolder)
AssetsManaging Assets

Set folder for an Asset

Was this page helpful?
Previous

Get all Asset folders

Next
Built with

Asset.setParent(assetFolder)

Sets the folder of the current Asset in the Webflow Designer

Syntax

1Asset.setParent(assetFolder: AssetFolder): Promise<null>

Returns

null

A Promise that resolves to null.

Example

1// Get all Assets
2const assets = await webflow.getAllAssets()
3const myAsset = assets[0]
4
5const folders = await webflow.getAllAssetFolders()
6const folder = folders[0]
7
8if (folder) {
9await myAsset.setParent(folder)
10console.log(`Asset: ${myAsset.id} moved to ${folder.id}`)
11} else {
12webflow.notify({ type: 'Error', message: 'Folder not found' })
13}

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManageAssetsAnyAnyAnyAny