queryReferenced( )


Developer Preview

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

Retrieves the full items referenced in the specified field of an item.

Reference and multi-reference fields refer to items in different collections. Use this method to retrieve the full details of the referenced items.

For example, suppose you have a Movies collection with an Actors field that contains references to items in a People collection. Querying the Movies collection using queryReferenced() retrieves the relevant People items referenced in the Actors field of the specified Movie item. This gives you information from the People collection about each of the actors in the specified movie.

The queryReferenced() method returns a Promise that resolves to the full items referenced in the specified property of the item from the specified collection. The Promise is rejected if the current user does not have read permissions for the specified collection or the collection containing the referenced items.

Notes:

Learn more about querying items that reference other items.

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

ID of the collection that contains the referring item.


referringItemunionRequired

Referring item or referring item's ID.


fieldstringRequired

Field that contains the references to the referenced items.


optionsWixDataReadWithProjectionOptions

Options for querying referenced data items.

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