> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name:

data.items.queryReferenced(dataCollectionId: string, referringItem: any, field: string, options: WixDataQueryReferencedOptions)

# Method Link:

https://dev.wix.com/docs/sdk/business-solutions/data/items/query-referenced.md

# Method Description:

undefined

# Method Permissions:



# Method Permissions Scopes IDs:

undefined



# Method Code Examples:

## Get referenced items

```javascript
import { items } from "@wix/data";

async function queryReferencedItems() {
  const results = await items.queryReferenced("movies", "00001", "actors");
    
  if(results.items.length > 0) {
    console.log(results.items[0]); //see item below
  } else {
    // handle case where no matching items found
  }
}

/*  firstItem is:
 *
 *  {
 *    "_id":          "12345",
 *    "_owner":       "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
 *    "_createdDate": "2017-05-24T12:33:18.938Z",
 *    "_updatedDate": "2017-05-24T12:33:18.938Z",
 *    "first_name":   "John",
 *    "last_name":    "Doe"
 *  }
 */

```



## Get referenced items using options

```javascript
import { items } from "@wix/data";

async function queryReferencedItems() {
  const options = {
    "order": "asc"
  };
  
  const results = await items.queryReferenced("movies", "00001", "actors", options);
    
  if(results.items.length > 0) {
    console.log(results.items[0]); // See below
  } else {
    // handle case where no matching items found
  } 
}

/*  firstItem is:
 *
 *  {
 *    "_id":          "12345",
 *    "_owner":       "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
 *    "_createdDate": "2017-05-24T12:33:18.938Z",
 *    "_updatedDate": "2017-05-24T12:33:18.938Z",
 *    "first_name":   "John",
 *    "last_name":    "Doe"
 *  }
 */
```

## default

```javascript
try {
      const result = await items.queryReferenced("collection-0.3927776720545557", "6892593d-d57f-428d-bc53-3f0870a1beef", "refs", { consistentRead: true });
      return result;
    } catch (error) {
      console.error(error);
      throw error;
   }
```