remove( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Removes an item from a collection.

The remove() method returns a Promise that resolves to the removed item after it has been removed from the specified collection. The Promise is rejected if the current user does not have "delete" permissions for the collection.

Calling the remove() method triggers the beforeRemove() and afterRemove() hooks if they have been defined.

Note: The remove() method also clears multiple-item reference fields for items in collections referenced by the specified item. For example, suppose you have a Movies collection with an Actors field that contains multiple references to items in a People collection. Removing an item in the Movies collection also clears the data in the corresponding multiple-item reference fields in the People collection.

Permissions
Write Data Items
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
dataCollectionIdstringRequired

ID of the collection that contains the item.


itemIdstringRequired

ID of the item to remove.


optionsWixDataOptions

Object containing options to use when processing this operation.

Returns
Return Type:Promise<WixDataItem>
Did this help?