Search element settings (Beta)

element.searchSettings()

Retrieve the configurable settings for an element, such as alt text, image source, heading tag, link target, and Collection List settings.

For standard element settings, the response includes current values, binding information, resolved values, and display labels. Collection List settings include current values and display labels.

This method is available on all element types that have at least one setting. Results can be filtered by value type or by setting key.

Beta

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

This method does not support component instances. To retrieve the properties of a component instance, use element.searchProps().

Syntax

1element.searchSettings(options?: SearchSettingsOptions): Promise<Record<string, SearchSettingsResult>>

Related interfaces:

1interface SearchSettingsOptions {
2 /** Filter to settings that produce a specific value type (e.g., "string", "image", "collectionListSetting") */
3 valueType?: SearchSettingValueType;
4 /** Filter to a specific setting by key (e.g., "domId", "assetId") */
5 key?: string;
6}
7
8interface ElementSetting {
9 valueType: BindableValueType;
10 canBind: boolean;
11 value: SettingValue;
12 resolvedValue: ResolvedValue | null;
13 display: SettingDisplay;
14}
15
16interface CollectionListElementSetting {
17 valueType: "collectionListSetting";
18 canBind: false;
19 value: CollectionListSettingValue;
20 display: SettingDisplay;
21}
22
23type SearchSettingsResult = ElementSetting | CollectionListElementSetting;
24type SearchSettingValueType = SearchSettingsResult["valueType"];
25
26type SettingValue =
27 | { sourceType: 'static'; value: unknown }
28 | { sourceType: 'prop'; propId: string; propName: string; propType: string }
29 | { sourceType: 'cms'; collectionId: string; collectionName: string; fieldId: string; fieldName: string }
30 | { sourceType: 'locale'; fieldKey: string; fieldName: string }
31 | { sourceType: 'localeItem'; fieldKey: string; fieldName: string }
32 | { sourceType: 'page'; fieldKey: string; fieldName: string }
33 | { sourceType: 'conditional' }
34 | { sourceType: 'legacy' };
35
36interface SettingDisplay {
37 label: string;
38 group: string | null;
39 trueLabel?: string;
40 falseLabel?: string;
41}
42
43type CollectionListSettingValue =
44 | CollectionListSource
45 | CollectionListFilter[]
46 | CollectionListSort[]
47 | CollectionListPagination
48 | CollectionListQueryMode
49 | CollectionListFilterMatch
50 | string[]
51 | number
52 | null;

Parameters

options (optional)

An object with the following optional properties:

PropertyTypeDescription
valueTypeSearchSettingValueTypeFilter results to settings that produce a specific value type, such as "string", "image", "link", "boolean", or "collectionListSetting".
keystringFilter results to a specific setting by key, such as "domId", "altText", or "assetId".

Both filters can be used together. When no options are provided, all settings for the element are returned.

Returns

Promise<Record<string, SearchSettingsResult>>

A Promise that resolves to an object mapping setting keys to setting result objects. Returns an empty object when the element has no settings or no settings match the filter criteria.

Standard ElementSetting objects have the following fields:

FieldTypeDescription
valueTypeBindableValueTypeThe data type this setting holds, such as "string", "image", "link", or "boolean".
canBindbooleanWhether this setting can be bound to a data source such as a prop, CMS field, or page field.
valueSettingValueThe current value. Always a { sourceType, ... } shape, as in the table below.
resolvedValueResolvedValue | nullThe final resolved value or null if the value is unset or unresolvable.
displaySettingDisplayDisplay metadata for rendering in UI. Includes label, group, and optional trueLabel and falseLabel for boolean settings.

Collection List settings use a structured CollectionListElementSetting object:

FieldTypeDescription
valueType"collectionListSetting"Identifies the setting as a Collection List setting.
canBindfalseCollection List settings don’t support binding through searchSettings().
valueCollectionListSettingValueThe current structured Collection List setting value.
displaySettingDisplayDisplay metadata for rendering in UI.

For Collection List settings, the record uses the Collection List setting names as keys: source, queryMode, filters, filterMatch, sort, limit, offset, pagination, and curatedItemIds. For example, results.source.value is the connected source, or null when the Collection List has no source.

For standard ElementSetting objects, the value field always uses a { sourceType, ... } shape. The possible variants are:

sourceTypeDescriptionAdditional fields
"static"A directly set valuevalue
"prop"Bound to a component proppropId, propName, propType
"cms"Bound to a CMS collection fieldcollectionId, collectionName, fieldId, fieldName
"locale"Bound to a field on the current localefieldKey, fieldName
"localeItem"Bound to a field on a locale list itemfieldKey, fieldName
"page"Bound to a field on the current pagefieldKey, fieldName
"conditional"Unsupported conditional binding(none)
"legacy"Unsupported legacy binding(none)

Notes

  • textContent-type setting values are returned as { innerText: string } objects rather than bare strings.
  • When a standard setting is bound to a CMS source, resolvedValue is null. This is a current limitation.
  • Both Form and FormBlock elements return the same form settings (name, method, action, redirect, state). Selecting either element returns those settings for convenience.
  • Collection List settings use valueType: "collectionListSetting". These entries don’t include resolvedValue. See Collection List settings.

Example

1// Get the selected element
2const element = await webflow.getSelectedElement();
3
4if (element) {
5 // Get all settings for the element
6 const allSettings = await element.searchSettings();
7 console.log(allSettings);
8 // Example result for an Image element:
9 // {
10 // altText: {
11 // valueType: 'altText',
12 // canBind: true,
13 // value: { sourceType: 'static', value: 'A sunset photo' },
14 // resolvedValue: 'A sunset photo',
15 // display: { label: 'Alt Text', group: null }
16 // },
17 // src: {
18 // valueType: 'image',
19 // canBind: true,
20 // value: { sourceType: 'static', value: 'asset_abc123' },
21 // resolvedValue: 'https://cdn.webflow.com/foo.jpg',
22 // display: { label: 'Image', group: null }
23 // },
24 // domId: {
25 // valueType: 'id',
26 // canBind: true,
27 // value: { sourceType: 'static', value: 'hero-img' },
28 // resolvedValue: 'hero-img',
29 // display: { label: 'ID', group: null }
30 // }
31 // }
32
33 // Filter to only image-type settings
34 const imageSettings = await element.searchSettings({ valueType: 'image' });
35
36 // Get a specific setting by key
37 const altTextSetting = await element.searchSettings({ key: 'altText' });
38}
1const collectionList = await webflow.getSelectedElement();
2
3if (collectionList?.type === "DynamoWrapper") {
4 const collectionListSettings = await collectionList.searchSettings({
5 valueType: "collectionListSetting",
6 });
7
8 console.log(collectionListSettings.source);
9 // {
10 // valueType: "collectionListSetting",
11 // canBind: false,
12 // value: { collectionId: "collection_123" },
13 // display: { label: "Source", group: "Collection List" }
14 // }
15
16 const filterSettings = await collectionList.searchSettings({ key: "filters" });
17 console.log(filterSettings.filters);
18 // {
19 // valueType: "collectionListSetting",
20 // canBind: false,
21 // value: [],
22 // display: { label: "Filters", group: "Collection List" }
23 // }
24}

Designer ability

Checks for authorization only

Designer abilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny