---
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>

parentEntities


</td><td>

Model&lt;T, T&gt;\[\]


</td><td>

source table data


</td></tr>
<tr><td>

parentEntityClass


</td><td>

typeof Entity


</td><td>

loopback entity class for the parent entity


</td></tr>
<tr><td>

inclusionFilters


</td><td>

[InclusionFilter](./filter.inclusionfilter.md)<!-- -->\[\]


</td><td>

_(Optional)_


</td></tr>
</tbody></table>
**Returns:**

Promise&lt;(T &amp; Relations)\[\]&gt;

entities with related models in them


