openItemSelector()

Opens an item selection modal that lets Wix users select items from a Wix service without leaving the dashboard. For example, Wix users can select products to feature in a store, pick blog posts for a custom layout, or choose contacts for a mailing list.

Important: This method is only available in the dashboard. It requires the workspace host to be initialized and an updated version of the host initialization package to be installed.

Items selection modal

Import statement

Copy

Method declaration

Copy

Parameters

NameTypeDescription
providerKeystringIdentifies the Wix service to load items from, determining what appears in the selector modal. For example, specifying the Products key loads items from the Wix Stores catalog. For supported values, see Available providers.
optionsItemSelectionOptions (optional)Configuration options for the item selection modal.

Returns

A promise that resolves to an ItemSelectionResult containing the selected items.

Available providers

The following table lists all available providers and the Wix business solutions that must be installed on a site for each provider to work.

ProviderproviderKeyDescriptionSite requirements
Products215238eb-22a5-4c36-9e7b-e7c08025e04e_productsProducts from the Wix Stores catalog.Wix Stores installed.
Categories215238eb-22a5-4c36-9e7b-e7c08025e04e_categoriesCatalogV3Product categories defined in Wix Stores.Wix Stores installed.
Coupons14d7032a-0a65-5270-cca7-30f599708fed_couponsPickerDiscount coupons from Wix Stores.Wix Stores installed.
Blog Posts14bcded7-0066-7c35-14d7-466cb3f09103_blogPostSelectionServicePublished blog posts from Wix Blog.Wix Blog installed.
Contacts74bff718-5977-47f2-9e5f-a9fd0047fd1f_ContactsItemsSelectionProviderContacts from the CRM contact list.Installed on all Wix sites by default.
Labels74bff718-5977-47f2-9e5f-a9fd0047fd1f_LabelsItemsSelectionContact labels used to organize CRM contacts.Installed on all Wix sites by default.
Assigneesf8859728-6fe9-49e6-8c63-8c7abf593087_AssigneesItemsSelectionProviderTeam members to assign to a task or item.Installed on all Wix sites by default.
Members14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9_members1Registered site members, searchable by login email.Wix Members Area installed.
Badges14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9_BadgesSelectionProviderBadges available to assign to site members.Wix Members Area installed.
Invoices13ee94c1-b635-8505-3391-97919052c16f_InvoiceSelectionProvider2Invoices from Wix Invoices.Installed on all Wix sites by default.
Price Quotes55cd9036-36bb-480b-8ddc-afda3cb2eb8d_PriceQuoteSelectionProvider2Price quotes from Wix Price Quotes.Installed on all Wix sites by default.
Email Campaigns135c3d92-0fea-1f9d-2ba5-2a1dfb04297e_campaignSelectionProviderEmail marketing campaigns for the site.Installed on all Wix sites by default.
Locations5b039bea-c008-4c3a-a717-24bc9388bf8c_LocationsProviderBusiness locations defined in Business Info.Installed on all Wix sites by default.
Site Pages14517e1a-3ff0-af98-408e-2bd6953c36a2_SitePagePages on a site.Installed on all Wix sites by default.

Objects

Item

Represents a selectable item in the item selector modal.

NameTypeDescription
idstringItem ID.
namestringOptional. Item name.
descriptionstringOptional. Item description.
imageobjectOptional. Item image. Contains a url property with the image URL.
notestringOptional. Additional information about the item, such as price.
additionalFieldsobjectOptional. Additional properties associated with the item. The available properties vary by provider.

ItemSelectionOptions

Configuration options for the item selection modal.

NameTypeDescription
maxSelectednumberOptional. The maximum number of items Wix users can select in the modal. Default: 1
primaryButtonTextstringOptional. Custom text for the primary action button in the modal.
titlestringOptional. Custom title for the modal.
initialSelectstring[]Optional. IDs of items that appear as selected when the modal opens.

ItemSelectionResult

Result returned from the item selection modal.

NameTypeDescription
itemsItem[]Array of selected items.

Examples

Open an item selector modal to select products:

Copy

Open an item selector modal with pre-selected items:

Copy

Errors

The method may throw errors in the following cases:

  • The workspace host isn't available on the current host environment. This method only works inside the Wix dashboard. Make sure you're calling it from a dashboard extension, not from a site page or a non-dashboard context. Learn how to initialize the workspace host.

  • The specified provider key is invalid or not found. The providerKey value doesn't match any supported provider. Check that you're using an exact value from the providerKey column in the Available providers table, including the app ID prefix.

Did this help?