---
lang: en
title: 'API docs: sequelize.sequelizecrudrepository.includereferencesifrequested'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/sequelize
permalink: /doc/en/lb4/apidocs.sequelize.sequelizecrudrepository.includereferencesifrequested.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/sequelize](./sequelize.md) &gt; [SequelizeCrudRepository](./sequelize.sequelizecrudrepository.md) &gt; [includeReferencesIfRequested](./sequelize.sequelizecrudrepository.includereferencesifrequested.md)

## SequelizeCrudRepository.includeReferencesIfRequested() method

Include related entities of `@referencesMany` relation

referencesMany relation is NOT handled by `sequelizeModel.findAll` as it doesn't have any direct alternative to it, so to include relation data of referencesMany, we're manually fetching related data requested

**Signature:**

```typescript
protected includeReferencesIfRequested(parentEntities: Model<T, T>[], parentEntityClass: typeof Entity, inclusionFilters?: InclusionFilter[]): Promise<(T & Relations)[]>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

parentEntities


</td><td markdown="1">

Model&lt;T, T&gt;\[\]


</td><td markdown="1">

source table data


</td></tr>
<tr><td markdown="1">

parentEntityClass


</td><td markdown="1">

typeof Entity


</td><td markdown="1">

loopback entity class for the parent entity


</td></tr>
<tr><td markdown="1">

inclusionFilters


</td><td markdown="1">

[InclusionFilter](./filter.inclusionfilter.md)<!-- -->\[\]


</td><td markdown="1">

_(Optional)_


</td></tr>
</tbody></table>

**Returns:**

Promise&lt;(T &amp; Relations)\[\]&gt;

entities with related models in them


