Move collection before target (Beta)

collection.moveBefore(target)

Moves this variable collection so that it appears immediately before target in the Variables panel display order.

The display order controls how collections are listed in the Webflow Designer’s Variables panel. This method does not affect variable values or references.

Beta

These methods are in public beta and may change with future releases.

Syntax

1collection.moveBefore(target: VariableCollection): Promise<null>

Parameters

  • target: VariableCollection — The collection before which this collection should be positioned.

Returns

Promise<null>

A Promise that resolves to null when the reorder is complete.

Example

1const collections = await webflow.getAllVariableCollections();
2
3// Move the last collection to the front
4if (collections.length >= 2) {
5 const [first, ...rest] = collections;
6 const last = rest[rest.length - 1];
7
8 await last.moveBefore(first);
9 console.log('Collection moved to front');
10}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyVariablesAnyMainCanvasDesign