replaceReferences( )


Replaces current references with references in the specified property.

The replaceReferences() function returns a Promise that resolves when the item's current references in the specified property are removed and references to the referenced items are added in their place. The Promise is rejected if the current user does not have update permissions for the collection.

Calling the replaceReferences() function does not trigger any hooks.

Note: The replaceReferences() function is not supported for Single Item Collections.

Method Declaration
Copy
Method Parameters
collectionIdstringRequired

The ID of the collection that contains the referring item.

To find your collectionId, select the Databases tab in the Velo Sidebar. Hover over your collection, click the three dots, and select Edit Settings.


propertyNamestringRequired

The property to replaces the references in.


referringItemunionRequired

The referring item or referring item's ID.


referencedItemunionRequired

The referenced item, referenced item's ID, an array of referenced items, or an array of referenced item IDs.


optionsWixDataOptions

An object containing options to use when processing this operation.

Was this helpful?
Yes
No